git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: John Keeping <john@keeping.me.uk>
To: David Aguilar <davvid@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Matt McClure <matthewlmcclure@gmail.com>,
	Tim Henigan <tim.henigan@gmail.com>
Subject: Re: [PATCH 2/2] difftool --dir-diff: symlink all files matching the working tree
Date: Thu, 14 Mar 2013 09:36:17 +0000	[thread overview]
Message-ID: <20130314093617.GM2317@serenity.lan> (raw)
In-Reply-To: <CAJDDKr5M4pqmd9HSVT8hDJB9AxgV2RexN6B6v6ccTS6raWY_Qg@mail.gmail.com>

On Wed, Mar 13, 2013 at 08:41:29PM -0700, David Aguilar wrote:
> On Wed, Mar 13, 2013 at 1:33 PM, John Keeping <john@keeping.me.uk> wrote:
> > diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> > index eb1d3f8..8102ce1 100755
> > --- a/t/t7800-difftool.sh
> > +++ b/t/t7800-difftool.sh
> > @@ -370,6 +370,20 @@ test_expect_success PERL 'difftool --dir-diff' '
> >         echo "$diff" | stdin_contains file
> >  '
> >
> > +write_script .git/CHECK_SYMLINKS <<\EOF &&
> 
> Tiny nit.  Is there any downside to leaving this file
> at the root instead of inside the .git dir?

I followed what some of the other uses of write_script (in other tests)
did.  I think putting it under .git is slightly better because it won't
show up as untracked in the repository but that shouldn't matter here,
so I'm happy to change it in a re-roll.

> > +#!/bin/sh
> > +test -L "$2/file" &&
> > +test -L "$2/file2" &&
> > +test -L "$2/sub/sub"
> > +echo $?
> > +EOF
> > +
> > +test_expect_success PERL,SYMLINKS 'difftool --dir-diff --symlink without unstaged changes' '
> > +       result=$(git difftool --dir-diff --symlink \
> > +               --extcmd "./.git/CHECK_SYMLINKS" branch HEAD) &&
> > +       test "$result" = 0
> > +'
> > +
> 
> How about something like this?
> 
> +       echo 0 >expect &&
> +       git difftool --dir-diff --symlink \
> +               --extcmd ./CHECK_SYMLINKS branch HEAD >actual &&
> +       test_cmp expect actual
> 
> (sans gmail whitespace damage) so that we can keep it chained with &&.

I hadn't considered using test_cmp, if we go that way I wonder if we can
do slightly better for future debugging.  Something like this perhaps?

+write_script .git/CHECK_SYMLINKS <<\EOF &&
+for f in file file2 sub/sub
+do
+	echo "$f"
+	readlink "$2/$f"
+done >actual
+EOF
+
+test_expect_success PERL,SYMLINKS 'difftool --dir-diff --symlink without unstaged changes' '
+	cat <<EOF >expect &&
+file
+$(pwd)/file
+file2
+$(pwd)/file2
+sub/sub
+$(pwd)/sub/sub
+EOF
+       git difftool --dir-diff --symlink \
+               --extcmd "./.git/CHECK_SYMLINKS" branch HEAD &&
+	test_cmp actual expect
+'

> Ah.. it seems your branch is based on master, perhaps?
>
> There's stuff cooking in next for difftool's tests.
> I'm not sure if this patch is based on top of them.
> Can you rebase the tests so that the chaining is done like it is in 'next'?

Yes it is based on master.  The cleanup on next looks good, I'll base
the re-roll on that.


John

  reply	other threads:[~2013-03-14  9:37 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 20:23 difftool -d symlinks, under what conditions Matt McClure
2012-11-27  6:20 ` David Aguilar
2012-11-27 21:10   ` Matt McClure
     [not found]   ` <CAJELnLEL8y0G3MBGkW+YDKtVxX4n4axJG7p0oPsXsV4_FRyGDg@mail.gmail.com>
2013-03-12 18:12     ` Matt McClure
2013-03-12 19:09       ` John Keeping
2013-03-12 19:23         ` David Aguilar
2013-03-12 19:43           ` John Keeping
2013-03-12 20:39             ` Junio C Hamano
2013-03-12 21:06               ` John Keeping
2013-03-12 21:26                 ` Junio C Hamano
2013-03-12 21:43                 ` Matt McClure
2013-03-12 22:11                   ` Matt McClure
2013-03-12 22:16                   ` Junio C Hamano
2013-03-12 22:48                     ` Matt McClure
2013-03-13  0:17                       ` John Keeping
2013-03-13  0:56                         ` Matt McClure
2013-03-13  8:24                         ` David Aguilar
2013-03-13 15:30                           ` Junio C Hamano
2013-03-13 16:45                             ` Junio C Hamano
2013-03-13 17:08                               ` John Keeping
2013-03-13 17:40                                 ` Junio C Hamano
2013-03-13 18:01                                   ` John Keeping
2013-03-13 19:28                                     ` Junio C Hamano
2013-03-13 20:33                                       ` [PATCH 0/2] difftool --dir-diff: symlink all files matching the working tree John Keeping
2013-03-13 20:33                                         ` [PATCH 1/2] git-difftool(1): fix formatting of --symlink description John Keeping
2013-03-13 20:33                                         ` [PATCH 2/2] difftool --dir-diff: symlink all files matching the working tree John Keeping
2013-03-14  3:41                                           ` David Aguilar
2013-03-14  9:36                                             ` John Keeping [this message]
2013-03-14 15:18                                           ` Junio C Hamano
2013-03-14 20:19                                         ` [PATCH v2 0/3] " John Keeping
2013-03-14 20:19                                           ` [PATCH v2 1/3] git-difftool(1): fix formatting of --symlink description John Keeping
2013-03-14 20:19                                           ` [PATCH v2 2/3] difftool: avoid double slashes in symlink targets John Keeping
2013-03-14 21:19                                             ` Junio C Hamano
2013-03-14 20:19                                           ` [PATCH v2 3/3] difftool --dir-diff: symlink all files matching the working tree John Keeping
2013-03-14 21:28                                             ` Junio C Hamano
2013-03-14 22:24                                               ` John Keeping
2013-03-14 22:31                                                 ` Junio C Hamano
2013-03-14  9:43                               ` difftool -d symlinks, under what conditions John Keeping
2013-03-14 17:25                                 ` John Keeping
2013-03-14 17:33                                   ` Junio C Hamano
2013-03-14 20:00                                     ` [PATCH 0/2] checkout-index: fix .gitattributes handling with --prefix John Keeping
2013-03-14 20:00                                       ` [PATCH 1/2] t2003: modernize style John Keeping
2013-03-14 20:00                                       ` [PATCH 2/2] entry: fix filter lookup John Keeping
2013-03-14 21:50                                         ` Junio C Hamano
2013-03-12 20:38           ` difftool -d symlinks, under what conditions Junio C Hamano
2013-03-12 19:24         ` [PATCH] difftool: Make directory diff symlink work tree John Keeping
2013-03-12 23:12           ` Matt McClure
2013-03-12 23:40             ` John Keeping
2013-03-13  0:26           ` Matt McClure
2013-03-13  9:11             ` John Keeping

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130314093617.GM2317@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=matthewlmcclure@gmail.com \
    --cc=tim.henigan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).