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

Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 24, 2013, 20:37 UTC
Message-ID
<20130424203732.GJ29963@google.com>
In-Reply-To
<CALkWK0=KWu3=j5sLK3hr=Gx5xLnLaPAY+E=J0_izRCj9YcBTEg@mail.gmail.com>
Ramkumar Ramachandra wrote:
> Jonathan Nieder wrote:
Show 9 quoted lines
>> Because typing paths does not make my intent perfectly clear.
>
> I'm not able to understand this.  Doesn't your prompt tell you which
> directory you're in, and if you're in a git repository?  When you type
> out paths, you know what is inside and what is outside your
> repository.  By extension, you know when --no-index is implied and
> when it isn't.
>
> Can you explain what your problem is?

Are you wondering why I use --no-index or why I think we should eventually stop moving into --no-index mode by default?

The answers are different. I use --no-index because it means I don't have to think about whether the files I am comparing are in a Git repository. It's relaxing. I'm not advocating that you follow suit; I'm just describing my own usage of the command.

I think git should eventually stop doing --no-index implicitly because it is a very different mode using the same syntax triggered by external conditions. That is

 * hard to document
 * problematic for scripts calling "git diff", can create lurking bugs
 * unnecessarily complicated.  For example:
   * "git diff -h" output depends on whether I am in a git worktree.
   * git searches for a .git directory, possibly hitting filesystem
     automount points, just to decide whether its arguments are inside
     the current repository.
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 27 of 39 in “Documentation/git-diff.txt improvements”
  1. 0/5 Documentation/git-diff.txt improvementsRamkumar Ramachandra, Apr 24, 2013
  2. 1/5 git-diff.txt: reorder the <commit> <commit> formRamkumar Ramachandra, Apr 24, 2013
  3. Jonathan NiederApr 24, 2013
  4. 2/5 git-diff.txt: strip the leading "--" from options templateRamkumar Ramachandra, Apr 24, 2013
  5. Jonathan NiederApr 24, 2013
  6. Ramkumar RamachandraApr 24, 2013
  7. Junio C HamanoApr 24, 2013
  8. 3/5 git-diff.txt: group the [--] and [<path>...] templatesRamkumar Ramachandra, Apr 24, 2013
  9. Junio C HamanoApr 24, 2013
  10. Ramkumar RamachandraApr 24, 2013
  11. Junio C HamanoApr 24, 2013
  12. Ramkumar RamachandraApr 24, 2013
  13. Junio C HamanoApr 24, 2013
  14. Ramkumar RamachandraApr 24, 2013
  15. Jonathan NiederApr 24, 2013
  16. 4/5 git-diff.txt: document the .. and ... forms in SYNOPSISRamkumar Ramachandra, Apr 24, 2013
  17. Jonathan NiederApr 24, 2013
  18. 5/5 git-diff.txt: fix ordering of the [--no-index] formRamkumar Ramachandra, Apr 24, 2013
  19. Junio C HamanoApr 24, 2013
  20. Ramkumar RamachandraApr 24, 2013
  21. Jonathan NiederApr 24, 2013
  22. Ramkumar RamachandraApr 24, 2013
  23. Jonathan NiederApr 24, 2013
  24. Ramkumar RamachandraApr 24, 2013
  25. Jonathan NiederApr 24, 2013
  26. Ramkumar RamachandraApr 24, 2013
  27. Jonathan NiederApr 24, 2013
  28. Ramkumar RamachandraApr 24, 2013
  29. Jonathan NiederApr 24, 2013
  30. Ramkumar RamachandraApr 24, 2013
  31. 6/5 git-diff.txt: banish the <commit>..<commit> formRamkumar Ramachandra, Apr 24, 2013
  32. Junio C HamanoApr 24, 2013
  33. Ramkumar RamachandraApr 24, 2013
  34. Ramkumar RamachandraApr 25, 2013
  35. Junio C HamanoApr 29, 2013
  36. Ramkumar RamachandraApr 29, 2013
  37. Junio C HamanoApr 29, 2013
  38. Ramkumar RamachandraApr 29, 2013
  39. Junio C HamanoApr 29, 2013

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.