Skip to contentSkip to conversation

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

PATCH In review Jonas Fonseca 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-rev-parse: Fix --short= option parsing

---
commit 16e2efc524d181cf46dcb252532139a0aff4a28f
tree c57ea8bf09b25fb643aadd224e7e73673187cc60
parent b867c7c23a42fbe9f261153a9814a5efbc071a29
author Jonas Fonseca <[email protected]> Sat, 18 Feb 2006 02:04:26 +0100 committer Jonas Fonseca <[email protected]> Sat, 18 Feb 2006 02:04:26 +0100

 rev-parse.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
rev-parse.c +3 -3
index b82f294..70a8271 100644
@@ -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)
Signature · 1 line
Jonas Fonseca
#1 lore raw

Thanks. I queued the two fixes from you.

They will first appear in "next" and also in 1.2.2.

Quoted 8 lines

---
commit 013b99654ee464856d266a72f0203d0fee2b0d11
tree 3c961d6ebb8b9805ee3950ec081679de15f5a9ba
parent 16e2efc524d181cf46dcb252532139a0aff4a28f
author Jonas Fonseca <[email protected]> Sat, 18 Feb 2006 02:05:11 +0100 committer Jonas Fonseca <[email protected]> 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.

#2 lore raw

Junio C Hamano <[email protected]> wrote Fri, Feb 17, 2006:

Quoted 10 lines
Quoted 8 lines

---
commit 013b99654ee464856d266a72f0203d0fee2b0d11
tree 3c961d6ebb8b9805ee3950ec081679de15f5a9ba
parent 16e2efc524d181cf46dcb252532139a0aff4a28f
author Jonas Fonseca <[email protected]> Sat, 18 Feb 2006 02:05:11 +0100 committer Jonas Fonseca <[email protected]> Sat, 18 Feb 2006 02:05:11 +0100

BTW, what git-based tool do you use to spit out this ugly format?

Cogito.

Quoted 5 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.

Signature · 1 line
Jonas Fonseca