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

[PATCH] annotate should number lines starting with 1

From
Luck, Tony <tony.luck@intel.com>
Date
Mar 2, 2006, 23:27 UTC
Message-ID
<200603022327.k22NRVek023304@agluck-lia64.sc.intel.com>

C programmers are well used to counting from zero, but every other text file tool starts counting from 1.

Signed-off-by: Tony Luck <tony.luck@intel.com>
---
diff --git a/git-annotate.perl b/git-annotate.perl
index 08d479f..d93ee19 100755
--- a/git-annotate.perl
+++ b/git-annotate.perl
@@ -128,7 +128,7 @@ foreach my $l (@filelines) {
 	}
 
 	printf("%s\t(%10s\t%10s\t%d)%s\n", $rev, $committer,
-		format_date($date), $i++, $output);
+		format_date($date), ++$i, $output);
 }
 
 sub init_claim {
Next: Junio C Hamano
Message 1 of 3 in “annotate should number lines starting with 1”
  1. annotate should number lines starting with 1Luck, Tony, Mar 2, 2006
  2. Junio C HamanoMar 3, 2006
  3. Junio C HamanoMar 3, 2006

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.