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

Re: GSoC 2015. Microprojects

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 15, 2015, 02:59 UTC
Message-ID
<xmqqtwxnufsz.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAHLaBNLX8KGUhROzW80SiM507=YpbfqdSiPm7Vm9vwK6vW-Z+Q@mail.gmail.com>
Yurii Shevtsov <ungetch@gmail.com> writes:
> As I understood there are four unsolved microprojects. I think I can
> deal with "Make "git diff --no-index $directory $file" DWIM better"
> but I don't understand what exactly should I do.
OK.
> I tried to run 'git
> diff --no-index ~/git/ diff.h' cmd on git sources but it says 'error:
> file/directory conflict: /home/localhost/git/, diff.h'.
There you have it.  Do you think erroring out is useful?  

Imagine a user who is used to the way ordinary "diff" command (not "git diff") operates. What would be the behaviour that may match the expectation of such a user better?

In other words, if you have the source tree of git in ~/git and then you have "diff.h" in your current directory, perhaps prepared by doing something like this:

    $ cd $HOME
    $ git clone git://git.kernel.org/pub/scm/git/git.git git
    $ mkdir junk
    $ cp git/diff.h junk
    $ cd junk
    $ echo hello >>diff.h

what would the ordinary "diff" say when you do these commands (still in that ~/junk directory)?

    $ diff -u ~/git diff.h
    $ diff -u diff.h ~/git

Wouldn't it be wonderful if "git diff --no-index" worked the same way as these?

Previous: Yurii Shevtsov
Message 2 of 2 in “GSoC 2015. Microprojects”
  1. Yurii ShevtsovMar 14, 2015
  2. Junio C HamanoMar 15, 2015

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.