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

Re: [PATCH v2 3/3] diff: turn skip_stat_unmatch on selectively

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 28, 2014, 23:52 UTC
Message-ID
<20140128235203.GA7788@lanh>
In-Reply-To
<xmqq7g9jlny6.fsf@gitster.dls.corp.google.com>
On Tue, Jan 28, 2014 at 02:51:45PM -0800, Junio C Hamano wrote:
Show 8 quoted lines
> >>  This replaces 'diff: turn off skip_stat_unmatch on "diff --cached"'
> >>  The previous patch obviously leaves skip_stat_unmatch on in "diff
> >>  <rev> <rev>" and maybe other cases.
> >
> > Oops, I lost track.  Sorry.
> 
> Together with {1,2}/3 applied on maint-1.8.4, this sems to break
> t3417 (there may be others, but I didn't have time to check).

My bad. I thought I covered all cases in my last patch (and didn't retest it!). It turns out I should have set skip_stat_unmatch in builtin_diff_b_f() too. This on top of 3/3 passes the tests

-- 8< --
diff --git a/builtin/diff.c b/builtin/diff.c
index 88542d9..8ab5e3d 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -89,6 +89,7 @@ static int builtin_diff_b_f(struct rev_info *revs,
 	if (blob[0].mode == S_IFINVALID)
 		blob[0].mode = canon_mode(st.st_mode);
 
+	revs->diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
 	stuff_change(&revs->diffopt,
 		     blob[0].mode, canon_mode(st.st_mode),
 		     blob[0].sha1, null_sha1,
-- 8< --
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 12 in “bug with git-diff --quiet”
  1. IWAMOTO ToshihiroJan 23, 2014
  2. Duy NguyenJan 25, 2014
  3. 1/3 Move diffcore_skip_stat_unmatch core logic out for reuse laterNguyễn Thái Ngọc Duy, Jan 25, 2014
  4. 2/3 diff: do not quit early on stat-dirty filesNguyễn Thái Ngọc Duy, Jan 25, 2014
  5. 3/3 diff: turn off skip_stat_unmatch on "diff --cached"Nguyễn Thái Ngọc Duy, Jan 25, 2014
  6. 3/3 diff: turn skip_stat_unmatch on selectivelyNguyễn Thái Ngọc Duy, Jan 27, 2014
  7. Junio C HamanoJan 27, 2014
  8. Junio C HamanoJan 28, 2014
  9. Duy NguyenJan 28, 2014
  10. Junio C HamanoJan 29, 2014
  11. Duy NguyenJan 30, 2014
  12. Junio C HamanoJan 31, 2014

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.