All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Move test-* to t/helper/ subdirectory
Date: Mon, 02 May 2016 10:34:28 -0700	[thread overview]
Message-ID: <xmqqk2jcuzx7.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160501060009.GA30748@lanh> (Duy Nguyen's message of "Sun, 1 May 2016 13:00:09 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> I may have rushed to judgement. wrap-for-bin.sh has always been the
> dependency for bin-wrappers/*. If we force that file to change, then
> bin-wrappers/* will be recreated when switching branches. So how about
> this?

I do not think you are "force updating wrap-for-bin" in any way in
the patch, though.  You are building it in such a way that it does
not have to get updated within the revision that contains e6e7530
(assuming that this will be queued directly on top it and merged to
everywhere e6e7530 is contained).

The new case/esac looks somewhat bad (its knowing that where test-*
lives, test-* is the only thing that is special, etc. troubles me at
the same time that case/esac is funnily formated).

Where does "@@PATH@@" come from and who rewrites it?  Is that a
misspelt "@@PROG@@"?

> -- 8< --
> Subject: [PATCH] wrap-for-bin.sh: handle t/helper/ paths internally
>
> Commit e6e7530 (test helpers: move test-* to t/helper/ subdirectory -
> 2016-04-13) moves test-* to t/helper. However because bin-wrappers/*
> only depend on wrap-for-bin.sh, when switching between a branch that has
> this commit and one that does not, bin-wrappers/* may not be regenerated
> and point to the old/outdated test programs. Fix it by force updating
> wrap-for-bin.sh so that it will be regenerated anyway.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  Makefile        |  2 +-
>  wrap-for-bin.sh | 12 ++++++++++--
>  2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index dd178ee..38dcdf7 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2204,7 +2204,7 @@ bin-wrappers/%: wrap-for-bin.sh
>  	@mkdir -p bin-wrappers
>  	$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
>  	     -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
> -	     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
> +	     -e 's|@@PROG@@|$(@F)|' < $< > $@ && \
>  	chmod +x $@
>  
>  # GNU make supports exporting all variables by "export" without parameters.
> diff --git a/wrap-for-bin.sh b/wrap-for-bin.sh
> index db0ec6a..bb334ed 100644
> --- a/wrap-for-bin.sh
> +++ b/wrap-for-bin.sh
> @@ -18,11 +18,19 @@ GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'"${GITPERLLIB:+:$GITPERLLIB}"
>  GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'
>  PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
>  export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
> +case "@@PATH@@" in
> +    test-*)
> +	PROG="${GIT_EXEC_PATH}/t/helper/@@PROG@@"
> +	;;
> +    *)
> +	PROG="${GIT_EXEC_PATH}/@@PROG@@"
> +	;;
> +esac
>  
>  if test -n "$GIT_TEST_GDB"
>  then
>  	unset GIT_TEST_GDB
> -	exec gdb --args "${GIT_EXEC_PATH}/@@PROG@@" "$@"
> +	exec gdb --args "$PROG" "$@"
>  else
> -	exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"
> +	exec "$PROG" "$@"
>  fi

  reply	other threads:[~2016-05-02 17:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 13:22 [PATCH] Move test-* to t/helper/ subdirectory Nguyễn Thái Ngọc Duy
2016-04-15 15:09 ` Junio C Hamano
2016-04-15 17:06   ` Junio C Hamano
2016-04-16  0:08     ` Duy Nguyen
2016-04-26 22:07 ` Junio C Hamano
2016-04-27  0:52   ` Duy Nguyen
2016-04-27 10:18     ` Duy Nguyen
2016-04-27 16:15       ` Junio C Hamano
2016-05-01  0:28         ` Duy Nguyen
2016-05-01  6:00           ` Duy Nguyen
2016-05-02 17:34             ` Junio C Hamano [this message]
2016-05-03  0:15               ` Duy Nguyen
2016-05-08  9:51                 ` Duy Nguyen
2016-05-09 16:03                   ` Junio C Hamano
2016-05-10 11:58                     ` Duy Nguyen
2016-05-10 20:23                       ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2011-02-09 22:15 [PATCH/RFC] Move test-*.c to test/ subdirectory Junio C Hamano
2011-02-10  2:14 ` [PATCH] Move test-* to t/helper/ subdirectory Nguyễn Thái Ngọc Duy

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

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

  git send-email \
    --in-reply-to=xmqqk2jcuzx7.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.