threads / patch / 3379

patchgit-rev-parse: Fix --short= option parsing

Subject: [PATCH] git-rev-parse: Fix --short= option parsing

## tl;dr

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

replies: 2people: 2as markdown or json

Jonas Fonseca· Feb 18, 2006, 01:10 UTC · lore
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>

--- commit 16e2efc524d181cf46dcb252532139a0aff4a28f tree c57ea8bf09b25fb643aadd224e7e73673187cc60 parent b867c7c23a42fbe9f261153a9814a5efbc071a29 author Jonas Fonseca <fonseca@diku.dk> Sat, 18 Feb 2006 02:04:26 +0100 committer Jonas Fonseca <fonseca@antimatter.localdomain> Sat, 18 Feb 2006 02:04:26 +0100

 rev-parse.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Show changes to rev-parse.c +3 −3
diff --git a/rev-parse.c b/rev-parse.c
index b82f294..70a8271 100644
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -225,12 +225,12 @@ int main(int argc, char **argv)
 				continue;
 			}
 			if (!strcmp(arg, "--short") ||
-			    !strncmp(arg, "--short=", 9)) {
+			    !strncmp(arg, "--short=", 8)) {
 				filter &= ~(DO_FLAGS|DO_NOREV);
 				verify = 1;
 				abbrev = DEFAULT_ABBREV;
-				if (arg[8] == '=')
-					abbrev = strtoul(arg + 9, NULL, 10);
+				if (arg[7] == '=')
+					abbrev = strtoul(arg + 8, NULL, 10);
 				if (abbrev < MINIMUM_ABBREV)
 					abbrev = MINIMUM_ABBREV;
 				else if (40 <= abbrev)
-- 
Jonas Fonseca
Junio C Hamano· Feb 18, 2006, 06:50 UTC · re: Jonas Fonseca · lore

Re: [PATCH] git-rev-parse: Fix --short= option parsing

Thanks.  I queued the two fixes from you.
They will first appear in "next" and also in 1.2.2.
Show 8 quoted lines
> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
>
> ---
> commit 013b99654ee464856d266a72f0203d0fee2b0d11
> tree 3c961d6ebb8b9805ee3950ec081679de15f5a9ba
> parent 16e2efc524d181cf46dcb252532139a0aff4a28f
> author Jonas Fonseca <fonseca@diku.dk> Sat, 18 Feb 2006 02:05:11 +0100
> committer Jonas Fonseca <fonseca@antimatter.localdomain> Sat, 18 Feb 2006 02:05:11 +0100

BTW, what git-based tool do you use to spit out this ugly format? Full object name of the parent commit is useful only if the recipient has that object, and it is not one of mine, so it is unlikely nobody but you would have it. Name of the tree is what you would get _after_ applying this patch, so it also is not very useful for e-mail communication.

Jonas Fonseca· Feb 18, 2006, 15:07 UTC · re: Junio C Hamano · lore

Re: [PATCH] git-rev-parse: Fix --short= option parsing

Junio C Hamano <junkio@cox.net> wrote Fri, Feb 17, 2006:
Show 10 quoted lines
> > Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
> >
> > ---
> > commit 013b99654ee464856d266a72f0203d0fee2b0d11
> > tree 3c961d6ebb8b9805ee3950ec081679de15f5a9ba
> > parent 16e2efc524d181cf46dcb252532139a0aff4a28f
> > author Jonas Fonseca <fonseca@diku.dk> Sat, 18 Feb 2006 02:05:11 +0100
> > committer Jonas Fonseca <fonseca@antimatter.localdomain> Sat, 18 Feb 2006 02:05:11 +0100
> 
> BTW, what git-based tool do you use to spit out this ugly format?
Cogito.
Show 5 quoted lines
> Full object name of the parent commit is useful only if the
> recipient has that object, and it is not one of mine, so it is
> unlikely nobody but you would have it.  Name of the tree is what
> you would get _after_ applying this patch, so it also is not
> very useful for e-mail communication.

I agree most of this is useless and will look into making a patch to so Cogito will also use the more or less standard From and Date headers with parent prefixed to the diff.

-- 
Jonas Fonseca

← back to recent threads