Re: [PATCH 0/2] "git add -A/--no-all" finishing touches

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

Re: [PATCH 0/2] "git add -A/--no-all" finishing touches

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:00

Junio C Hamano [off-list ref] writes:
Jonathan Nieder [off-list ref] writes:
quoted
Junio C Hamano wrote:
quoted
At the point of calling warn_pathless_add(), it seems that we are
triggering this for paths that are not necessarily modified when run
with "add -n -u".
Do you mean files that were touched but have no content change, or
something more subtle?
I had the change (which by the way needs a fix for the "found a
directory" codepath) on top of master, uncommitted, and no other
change (I also have some cruft that is not ignored).

    cd Documentation && ../git add -n -u

reported GIT-VERSION-GEN which was not touched.  It does not
reproduce, though...
Ahh, I haven't run anything under the debugger yet, but I think I
know what is going on.

Don't we limit our "update-index --refresh" equivalent to the
original pathspec, even though your "-u/-A sans pathspec" warning
detection relies on grabbing the changes from the entire tree?

Re: [PATCH 0/2] "git add -A/--no-all" finishing touches

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:57:00

Junio C Hamano wrote:
quoted
Jonathan Nieder [off-list ref] writes:
quoted
quoted
Do you mean files that were touched but have no content change, or
something more subtle?
[...]
Ahh, I haven't run anything under the debugger yet, but I think I
know what is going on.

Don't we limit our "update-index --refresh" equivalent to the
original pathspec, even though your "-u/-A sans pathspec" warning
detection relies on grabbing the changes from the entire tree?
I think it's more basic than that.  "git add" doesn't bother to
run an "update-index --refresh" equivalent before its main loop
unless you pass --refresh to it, since reading files to compare
them to the index would be duplicated work.  The files hit in
update_callback() are only potentially modified.

Maybe the warning should happen after add_file_to_index() has run,
letting git compare the old and new index entries for that path?

Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help