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

Re: [PATCH 2/2] difftool: allow running outside Git worktrees with --no-index

From
Jeff King <peff@peff.net>
Date
Mar 15, 2019, 03:08 UTC
Message-ID
<20190315030811.GA28943@sigill.intra.peff.net>
In-Reply-To
<nycvar.QRO.7.76.6.1903141305550.41@tvgsbejvaqbjf.bet>
On Thu, Mar 14, 2019 at 01:16:45PM +0100, Johannes Schindelin wrote:
> In other words, my take is that the ways in which `--no-index` is used are
> probably not very different from one another, and the bugs lurk in
> really rarely exercised code paths.

Yeah, that's more likely (and consistent with the bugs I remember fixing in the last few years).

> > We'd just have to remember to add it back to the argv of diff
> > sub-commands we run.
> 
> It was that "add it back" that I was not keen to implement.

Yes, I saw that we pass on the argv we get back from parse_options() literally to the sub-functions. I was thinking you'd do some trickery with an argv_array. But I like your approach of using OPT_ARGUMENT() much better.

Show 6 quoted lines
> So I was already done with implementing `OPT_ARGUMENT_SEEN()`, based on
> `OPT_ARGUMENT()`, and testing it with my difftool patch, when it occurred
> to me to look what existing users of `OPT_ARGUMENT()` do. Guess what:
> there are none, apart from that test helper used in t0040 to verify that
> `parse_options()` works as intended. And there were none other. In the
> entire commit history.

Heh. That is not the first time I have hit that with the parse-options code.

I see you posted the new patches, so I'll try to give a careful read in that part of the thread.

-Peff
Previous: Johannes SchindelinNext: Johannes Schindelin via GitGitGadget
Message 5 of 17 in “Allow difftool to be run outside of Git worktrees”
  1. 0/2 Allow difftool to be run outside of Git worktreesJohannes Schindelin via GitGitGadget, Mar 13, 2019
  2. 2/2 difftool: allow running outside Git worktrees with --no-indexJohannes Schindelin via GitGitGadget, Mar 13, 2019
  3. Jeff KingMar 13, 2019
  4. Johannes SchindelinMar 14, 2019
  5. Jeff KingMar 15, 2019
  6. 1/2 difftool: remove obsolete (and misleading) commentJohannes Schindelin via GitGitGadget, Mar 13, 2019
  7. 0/3 Allow difftool to be run outside of Git worktreesJohannes Schindelin via GitGitGadget, Mar 14, 2019
  8. 1/3 difftool: remove obsolete (and misleading) commentJohannes Schindelin via GitGitGadget, Mar 14, 2019
  9. 2/3 parse-options: make OPT_ARGUMENT() more usefulJohannes Schindelin via GitGitGadget, Mar 14, 2019
  10. Jeff KingMar 15, 2019
  11. Johannes SchindelinMar 15, 2019
  12. Junio C HamanoMar 18, 2019
  13. Jeff KingMar 18, 2019
  14. Junio C HamanoMar 19, 2019
  15. 3/3 difftool: allow running outside Git worktrees with --no-indexJohannes Schindelin via GitGitGadget, Mar 14, 2019
  16. Jeff KingMar 15, 2019
  17. Johannes SchindelinMar 15, 2019

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.