threads / patch / 3530

patchannotate should number lines starting with 1

Subject: [PATCH] annotate should number lines starting with 1

## tl;dr

3 messages between Mar 2, 2006 and Mar 3, 2006. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Luck, Tony· Mar 2, 2006, 23:27 UTC · lore

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>
---
Show changes to git-annotate.perl +1 −1
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 {
Junio C Hamano· Mar 3, 2006, 07:09 UTC · re: Luck, Tony · lore

Re: [PATCH] annotate should number lines starting with 1

"Luck, Tony" <tony.luck@intel.com> writes:
> C programmers are well used to counting from zero, but every
> other text file tool starts counting from 1.
Thanks.
I agree with this patch 100%, so I am going to take this patch.

But git-cvsserver might need some adjustments. Martin?

Junio C Hamano· Mar 3, 2006, 07:09 UTC · re: Luck, Tony · lore

Re: [PATCH] annotate should number lines starting with 1

"Luck, Tony" <tony.luck@intel.com> writes:
> C programmers are well used to counting from zero, but every
> other text file tool starts counting from 1.
Thanks.
I agree with this patch 100%, so I am going to take this patch.

But git-cvsserver might need some adjustments. Martin?

← back to recent threads