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

Re: [PATCH] t7800-difftool: don't accidentally match tmp dirs

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 8, 2021, 15:23 UTC
Message-ID
<nycvar.QRO.7.76.6.2101081622530.2213@tvgsbejvaqbjf.bet>
In-Reply-To
<20210108092036.GR8396@szeder.dev>
Hi Gábor,
On Fri, 8 Jan 2021, SZEDER Gábor wrote:
Show 43 quoted lines
> On Wed, Jan 06, 2021 at 10:24:27PM -0800, Junio C Hamano wrote:
> > SZEDER Gábor <szeder.dev@gmail.com> writes:
> >
> > > diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> > > index a578b35761..fe02fe1688 100755
> > > --- a/t/t7800-difftool.sh
> > > +++ b/t/t7800-difftool.sh
> > > @@ -439,73 +439,104 @@ run_dir_diff_test () {
> > >  }
> > >
> > >  run_dir_diff_test 'difftool -d' '
> > > +	cat >expect <<-\EOF &&
> > > +	file
> > > +	file2
> > > +
> > > +	file
> > > +	file2
> > > +	sub
> > > +	EOF
> > >  	git difftool -d $symlinks --extcmd ls branch >output &&
> > > -	grep sub output &&
> > > -	grep file output
> > > +	grep -v ^/ output >actual &&
> >
> > This unfortunately would not catch full paths on certain platforms.
> >
> > See https://github.com/git/git/runs/1660588243?check_suite_focus=true#step:7:4186
> > for an example X-<.
>
> Hrm, one has to log in to view those CI logs?  Really?! :(
>
> Anyway, I (apparently falsely) assumed that the output these tests
> look at come from Git itself, and therefore we can rely on difftool's
> temporary directories being normalized UNIX-style absolute paths...
> But it seems they don't actually come from Git but from 'ls', because
> that's what those '--extcmd ls' options do, and I now going to assume
> that 'ls' prints those absolute paths with drive letter prefixes and
> whatnot on Windows.
>
> The initial version of this patch just tightened all potentially
> problematic 'grep' patterns, e.g. 'grep ^sub$ output && grep ^file$
> output'.  That should work on Windows as well, shouldn't it.  Will see
> whether I can dig it out from the reflogs.
The logs ends thusly:
-- snipsnap --
 ++++ diff -u expect actual
--- expect	2021-01-07 05:12:54.687742100 +0000
+++ actual	2021-01-07 05:12:55.370745600 +0000
@@ -1,6 +1,8 @@
+C:\Users\RUNNER~1\AppData\Local\Temp/git-difftool.a01364/left/:
 file
 file2

+C:\Users\RUNNER~1\AppData\Local\Temp/git-difftool.a01364/right/:
 file
 file2
 sub
error: last command exited with $?=1
not ok 42 - difftool -d --no-symlinks
Previous: SZEDER GáborNext: Junio C Hamano
Message 4 of 7 in “t7800-difftool: don't accidentally match tmp dirs”
  1. t7800-difftool: don't accidentally match tmp dirsSZEDER Gábor, Dec 24, 2020
  2. Junio C HamanoJan 7, 2021
  3. SZEDER GáborJan 8, 2021
  4. Johannes SchindelinJan 8, 2021
  5. Junio C HamanoJan 8, 2021
  6. t7800-difftool: don't accidentally match tmp dirsSZEDER Gábor, Jan 9, 2021
  7. Junio C HamanoJan 9, 2021

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.