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

[PATCH] add -p: make the beginning of the hunk easier to see

From
Björn Gustavsson <bgustavsson@gmail.com>
Date
Feb 13, 2010, 11:07 UTC
Message-ID
<4B768807.3030003@gmail.com>

When using "git add -p" to selectively add hunks, I find it hard to quickly see where the current hunk starts and the previous stops, because the new hunk starts right after the action prompt for the previous hunk.

Facilitate easy scanning for the beginning of the current hunk by adding some blank lines and a line of equal signs before the current hunk.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
---
 git-add--interactive.perl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index cd43c34..4eb7c7c 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1439,6 +1439,8 @@ sub patch_update_file {
 					 !defined $hunk[$ix]{USE});
 			}
 		}
+	} continue {
+		print "\n" x 4, '=' x 72, "\n";
 	}
 
 	@hunk = coalesce_overlapping_hunks(@hunk);
-- 
1.7.0
Next: Jeff King
Message 1 of 10 in “add -p: make the beginning of the hunk easier to see”
  1. add -p: make the beginning of the hunk easier to seeBjörn Gustavsson, Feb 13, 2010
  2. Jeff KingFeb 13, 2010
  3. Jeff KingFeb 13, 2010
  4. Björn GustavssonFeb 13, 2010
  5. Björn GustavssonFeb 13, 2010
  6. Björn GustavssonFeb 13, 2010
  7. Jeff KingFeb 13, 2010
  8. Björn GustavssonFeb 13, 2010
  9. Julian PhillipsFeb 13, 2010
  10. Björn GustavssonFeb 13, 2010

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.