Re: [PATCH v4 12/14] fix 'git update-index --verbose --again' output

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v4 12/14] fix 'git update-index --verbose --again' output

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:59:11

Karsten Blees [off-list ref] writes:
'git update-index --verbose' consistently reports paths relative to the
work-tree root. The only exception is the '--again' option, which reports
paths relative to the current working directory.

Change do_reupdate to use non-prefixed paths.
Interesting.

This looks like a genuine fix unrelated to the use of the new hashmap.
quoted hunk
Signed-off-by: Karsten Blees <redacted>
---
 builtin/update-index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/update-index.c b/builtin/update-index.c
index e3a10d7..d180d80 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -579,7 +579,7 @@ static int do_reupdate(int ac, const char **av,
 		 * or worse yet 'allow_replace', active_nr may decrease.
 		 */
 		save_nr = active_nr;
-		update_one(ce->name + prefix_length, prefix, prefix_length);
+		update_one(ce->name, NULL, 0);
 		if (save_nr != active_nr)
 			goto redo;
 	}

Re: [PATCH v4 12/14] fix 'git update-index --verbose --again' output

From: Karsten Blees <hidden>
Date: 2016-06-15 22:59:12

Am 07.11.2013 23:12, schrieb Junio C Hamano:
Karsten Blees [off-list ref] writes:
quoted
'git update-index --verbose' consistently reports paths relative to the
work-tree root. The only exception is the '--again' option, which reports
paths relative to the current working directory.

Change do_reupdate to use non-prefixed paths.
Interesting.

This looks like a genuine fix unrelated to the use of the new hashmap.
Indeed, #13 as well (and #4, #5, for that matter). I stumbled across this when analysing Thomas' last valgrind report.

Note that #12, #13 are prequels to #14, which adds a "char *path = xstrdup(ce->name); ... free(path)" around the update_one call.
quoted
Signed-off-by: Karsten Blees <redacted>
---
 builtin/update-index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/update-index.c b/builtin/update-index.c
index e3a10d7..d180d80 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -579,7 +579,7 @@ static int do_reupdate(int ac, const char **av,
 		 * or worse yet 'allow_replace', active_nr may decrease.
 		 */
 		save_nr = active_nr;
-		update_one(ce->name + prefix_length, prefix, prefix_length);
+		update_one(ce->name, NULL, 0);
 		if (save_nr != active_nr)
 			goto redo;
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help