Re: [PATCH/RFC][GSoC] make "git diff --no-index $directory $file" DWIM better.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 16, 2015, 19:20 UTC
- Message-ID
- <xmqq3854rbpj.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAHLaBN+FZ5LLwU-6VnFoPva=omtPpCEPzmdvY_3H43dag8kqxg@mail.gmail.com>
Yurii Shevtsov <ungetch@gmail.com> writes:
Show 8 quoted lines
> Yes, I have red what you wrote several times and tried your example. > I'm really sorry if I sound like I just ignored it. I just got a > little bit lost about which procedure needs patching. You're > absolutely right, queue_diff() is wrong place for it. So do you agree > that "append the name of the file at the end of the directory" logic > should be put to diff_no_index() which will also include calling > get_mode() for each path[] member? Sorry again for asking so much > questions
Questions are to be asked; no need to apologize.
I think that the "if asked to compare D and F, pretend as if asked to compare D/F and F" and friends (meaning, "if asked to compare F and D, compare F and D/F" needs to be handled the same way, and also it needs to handle the case where "D/F" does *not* exist) logic can be added to diff_no_index() just before it calls queue_diff().
"If one is directory but not the other, return an error" code may need to be fixed but I think that would be a larger change than a few hours work (which I understand is the size GSoC Micro aims for).