git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/1] git-add--interactive.perl: Add progress counter in the prompt

From
KGKunal Tyagi via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 23, 2019, 07:26 UTC
Message-ID
<pull.349.git.gitgitgadget@gmail.com>
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
Kunal Tyagi (1):
  git-add--interactive.perl: Add progress counter in the prompt
 git-add--interactive.perl  | 2 +-
 t/t3701-add-interactive.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
base-commit: 4c86140027f4a0d2caaa3ab4bd8bfc5ce3c11c8a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-349%2Fkunaltyagi%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-349/kunaltyagi/master-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/349
-- 
gitgitgadget
Next: Kunal Tyagi via GitGitGadget
Message 1 of 11 in “git-add--interactive.perl: Add progress counter in the prompt”
  1. 0/1 git-add--interactive.perl: Add progress counter in the promptKunal Tyagi via GitGitGadget, Sep 23, 2019
  2. 1/1 git-add--interactive.perl: Add progress counter in the promptKunal Tyagi via GitGitGadget, Sep 23, 2019
  3. Johannes SchindelinSep 25, 2019
  4. Johannes SchindelinSep 25, 2019
  5. 0/1 git-add--interactive.perl: Add progress counter in the promptKunal Tyagi via GitGitGadget, Sep 29, 2019
  6. 1/1 git-add--interactive.perl: Add progress counter in the promptKunal Tyagi via GitGitGadget, Sep 29, 2019
  7. Junio C HamanoSep 30, 2019
  8. Johannes SchindelinSep 30, 2019
  9. 0/1 git-add--interactive.perl: Add progress counter in the promptKunal Tyagi via GitGitGadget, Sep 30, 2019
  10. 1/1 add -i: Show progress counter in the promptKunal Tyagi via GitGitGadget, Sep 30, 2019
  11. Junio C HamanoOct 4, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.