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

Re: [PATCH 1/4] stash: pass --no-color to diff-tree child processes

From
Jeff King <peff@peff.net>
Date
Sep 8, 2025, 16:06 UTC
Message-ID
<20250908160628.GB1308482@coredump.intra.peff.net>
In-Reply-To
<aLfs5EDk-krJHnmQ@pks.im>
On Wed, Sep 03, 2025 at 09:23:16AM +0200, Patrick Steinhardt wrote:
Show 15 quoted lines
> > @@ -1345,6 +1346,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps,
> >  
> >  	cp_diff_tree.git_cmd = 1;
> >  	strvec_pushl(&cp_diff_tree.args, "diff-tree", "-p", "-U1", "HEAD",
> > +		     "--no-color",
> >  		     oid_to_hex(&info->w_tree), "--", NULL);
> >  	if (pipe_command(&cp_diff_tree, NULL, 0, out_patch, 0, NULL, 0)) {
> >  		ret = -1;
> 
> All of these make sense. It feels a bit like whack-a-mole, and fixing
> the root cause would address that. But I also understand that you shy
> away from addressing it due to the high chance for regressions.
> 
> There's also a call to "diff-index" in the same file. Do we also need to
> adjust that instance?

I was focused on the "-p" code path, but yes, I think it fails when we stash an index change with GIT_PAGER_IN_USE=1. I've fixed it and added a new test in my re-roll.

-Peff
Previous: Patrick SteinhardtNext: Jeff King
Message 8 of 23 in “[BUG] Some subcommands ignore color.diff and color.ui in --patch mode”
  1. Isaac Oscar GarianoAug 20, 2025
  2. Jeff KingAug 20, 2025
  3. Isaac Oscar GarianoAug 20, 2025
  4. Jeff KingAug 21, 2025
  5. 0/4 oddities around add-interactive and colorJeff King, Aug 21, 2025
  6. 1/4 stash: pass --no-color to diff-tree child processesJeff King, Aug 21, 2025
  7. Patrick SteinhardtSep 3, 2025
  8. Jeff KingSep 8, 2025
  9. 2/4 add-interactive: respect color.diff for diff coloringJeff King, Aug 21, 2025
  10. Patrick SteinhardtSep 3, 2025
  11. Jeff KingSep 8, 2025
  12. Patrick SteinhardtSep 9, 2025
  13. 3/4 add-interactive: manually fall back color config to color.uiJeff King, Aug 21, 2025
  14. Junio C HamanoAug 21, 2025
  15. Patrick SteinhardtSep 3, 2025
  16. Jeff KingSep 8, 2025
  17. 4/4 contrib/diff-highlight: mention interactive.diffFilterJeff King, Aug 21, 2025
  18. 0/4 oddities around add-interactive and colorJeff King, Sep 8, 2025
  19. 1/4 stash: pass --no-color to diff plumbing child processesJeff King, Sep 8, 2025
  20. 2/4 add-interactive: respect color.diff for diff coloringJeff King, Sep 8, 2025
  21. 3/4 add-interactive: manually fall back color config to color.uiJeff King, Sep 8, 2025
  22. 4/4 contrib/diff-highlight: mention interactive.diffFilterJeff King, Sep 8, 2025
  23. Patrick SteinhardtSep 9, 2025

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.