-
Notifications
You must be signed in to change notification settings - Fork 140
git-add--interactive.perl: Add progress counter in the prompt #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Welcome to GitGitGadgetHi @kunaltyagi, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests. Please make sure that this Pull Request has a good description, as it will be used as cover letter. Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:
It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code. Contributing the patchesBefore you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a PR comment of the form Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions. If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox ("raw") file corresponding to the mail you want to reply to from the Git mailing list. If you use GMail, you can upload that raw mbox file via: curl -g --user "<EMailAddress>:<Password>" --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt |
/allow |
User kunaltyagi is now allowed to use GitGitGadget. |
/submit |
Submitted as [email protected] |
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
/submit |
Submitted as [email protected] |
Report the current hunk count and total number of hunks for the current file in the prompt Adjust the expected output in some tests to account for new data on the prompt Signed-off-by: Kunal Tyagi <[email protected]>
Hi Thanks for your comments. I've modified the patch and I hope it is more suitable now. I just used a repl to get the output and sent that as a patch. I don't really know perl (though printf syntax is almost universal). Cheers |
/submit |
Submitted as [email protected] |
This branch is now known as |
This patch series was integrated into pu via git@60d083e. |
@@ -1541,7 +1541,7 @@ sub patch_update_file { | |||
for (@{$hunk[$ix]{DISPLAY}}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):
"Kunal Tyagi via GitGitGadget" <[email protected]> writes:
> From: Kunal Tyagi <[email protected]>
>
> Report the current hunk count and total number of hunks for the current
> file in the prompt
> Adjust the expected output in some tests to account for new data on the prompt
>
> Signed-off-by: Kunal Tyagi <[email protected]>
> ---
> git-add--interactive.perl | 2 +-
> t/t3701-add-interactive.sh | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Thanks; queued.
This patch series was integrated into pu via git@3912675. |
This patch series was integrated into pu via git@e9c7cd0. |
This patch series was integrated into pu via git@a273a14. |
This patch series was integrated into next via git@00cf8fe. |
This patch series was integrated into pu via git@5e871a3. |
This patch series was integrated into pu via git@eb33b78. |
This patch series was integrated into pu via git@fc1af0b. |
This patch series was integrated into pu via git@f0d407e. |
This patch series was integrated into next via git@f0d407e. |
This patch series was integrated into master via git@f0d407e. |
Closed via f0d407e. |
🎉 |
I was actually wondering if it would be an improvement to add information regarding total files or hunks being considered instead of per file (possibly in the C version not the perl one)
|
It would be an improvement, but the current code is really focused on individual files... Therefore it would take quite a bit more surgery to get that information. |
Which branch is the C development going on? |
Hi git contributors!
I'm Kunal Tyagi. While I was choosing the relevant patches for a commit using the
git add -p
command, I found that there was no feedback regarding how many hunks from the current file had been processed and how many were left. So I decided to add a small change to the prompt which basically just displays(${current-hunk-id} + 1/${total-hunks})
before displaying the prompt during user interaction. This patch doesn't account for all total hunks, only per file.I don't know perl so even this one liner might have mistakes. I did test this locally and hope this works for others. Personally, this change feels helpful to me when I have to separate a long list of changes after an erroneous commit.
On the #git-devel freenode channel, I was informed that @dscho is rewriting git-add in C. If so, perhaps a similar change could be added in the rewrite. I haven't seen his patches in detail so I can't comment if it'll be as trivial as in perl.
Regards
Kunal Tyagi