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

Re: What's cooking in git.git (Feb 2010, #05; Sun, 21)

From
Jeff King <peff@peff.net>
Date
Feb 23, 2010, 00:53 UTC
Message-ID
<20100223005345.GA3254@coredump.intra.peff.net>
In-Reply-To
<7viq9paunm.fsf@alter.siamese.dyndns.org>
On Mon, Feb 22, 2010 at 12:21:33PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> > True, though most of those pathspecs for tracked files are when viewing
> > diffs. It seems more inconsistent here because "git add foo" complains
> > but "git add -u foo" does not. So I think this one is definitely worth
> > fixing.
> 
> One problem is that it would be adding a new inconsistency.
> 
> "git diff" does not complain but "git add -u" will complain if we make
> this change, but "add -u" is about updating the path that "git diff"
> reports as different.

I see. Personally I don't mind that inconsistency as much, as it is between two commands, rather than between flags within one command. But that is perhaps a subjective evaluation.

But:
Show 8 quoted lines
> Making "add -u" complain before fixing "diff-files" will have another
> issue.  It will expose a bigger inconsistency that you omitted from my
> message ;-) The pathspec "git add" without "-u" takes are processed by
> pathspec match logic of "ls-files" family, but "git add -u" uses pathspec
> match logic of "diff" family.  They have different semantics.
> 
> You can say "git add 'frotz/*.c'" but not "git add -u 'frotz/*.c'"; that
> also needs to be fixed.

That is a more worrisome inconsistency to me (and now I get what you were saying in your earlier message).

> Making "add -u" alone complain using a separate throw-away logic that we
> are sure we will have to discard when we make things consistent throughout
> the system did not sound very attractive to me.  And that is why I was
> unhappy about the solution.

OK, now I am unhappy about it, too, and I agree it should be addressed in the long term. But that is a large-ish project that will not happen immediately. What is the best thing in the meantime?

I am still tempted by the patch. Even though it trades one inconsistency for another, I find a false sense of success from "git-add" to be one of the more ugly errors (and even though "git add -u 'frotz/*.c'" would still not work with it, at least you would be informed of such).

-Peff
Previous: Junio C Hamano
Message 13 of 13 in “What's cooking in git.git (Feb 2010, #05; Sun, 21)”
  1. Junio C HamanoFeb 22, 2010
  2. Larry D'AnnaFeb 22, 2010
  3. Johannes SixtFeb 22, 2010
  4. Junio C HamanoFeb 22, 2010
  5. Björn GustavssonFeb 22, 2010
  6. Johannes SchindelinFeb 22, 2010
  7. Thomas RastFeb 22, 2010
  8. Thomas RastFeb 22, 2010
  9. Johannes SchindelinFeb 22, 2010
  10. Jeff KingFeb 22, 2010
  11. Jeff KingFeb 22, 2010
  12. Junio C HamanoFeb 22, 2010
  13. Jeff KingFeb 23, 2010

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.