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

Re: [PATCH] post-checkout hooks and related tests

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2007, 23:17 UTC
Message-ID
<7vve9y2v39.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1190760563-32453-1-git-send-email-jjengla@sandia.gov>
"Josh England" <jjengla@sandia.gov> writes:
Show 12 quoted lines
> diff --git a/git-checkout.sh b/git-checkout.sh
> index 17f4392..78355eb 100755
> --- a/git-checkout.sh
> +++ b/git-checkout.sh
> @@ -137,6 +137,13 @@ Did you intend to checkout '$@' which can not be resolved as commit?"
>  	git ls-files --error-unmatch -- "$@" >/dev/null || exit
>  	git ls-files -- "$@" |
>  	git checkout-index -f -u --stdin
> +
> +        # Run a post-checkout hook -- the HEAD does not change so the
> +	# current HEAD is passed in for both args
> +	if test -x "$GIT_DIR"/hooks/post-checkout; then

It is usually a good idea to view your patch in your MUA before sending them out.

You will spot HT vs SP indentation inconsistencies right away.

HEAD did not change but don't you want to differenciate if the checkout was from the index or from the HEAD? If not why not?

Previous: Junio C HamanoNext: Josh England
Message 5 of 6 in “post-checkout hooks and related tests”
  1. post-checkout hooks and related testsJosh England, Sep 25, 2007
  2. post-merge hook and related testsJosh England, Sep 25, 2007
  3. Documentation for post-checkout and post-merge hooksJosh England, Sep 25, 2007
  4. Junio C HamanoSep 25, 2007
  5. Junio C HamanoSep 25, 2007
  6. Josh EnglandSep 26, 2007

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.