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

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

From
Jonas Fonseca <fonseca@diku.dk>
Date
Feb 18, 2006, 01:10 UTC
Message-ID
<20060218011053.GB2562@diku.dk>
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(-)
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
Next: Junio C Hamano
Message 1 of 3 in “git-rev-parse: Fix --short= option parsing”
  1. git-rev-parse: Fix --short= option parsingJonas Fonseca, Feb 18, 2006
  2. Junio C HamanoFeb 18, 2006
  3. Jonas FonsecaFeb 18, 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.