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

Re: [PATCH] git-pull: don't complain about branch merge config if only fetching tags

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 21, 2007, 16:35 UTC
Message-ID
<7v8x3oatvi.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071221124400.20725.qmail@db93e79e204cd8.315fe32.mid.smarden.org>
Gerrit Pape <pape@smarden.org> writes:
Show 28 quoted lines
> When running git pull with the -t switch, it properly fetches tags, but
> complains about missing information on how to merge.  Since there's
> nothing to merge, make git-pull simply exit after fetching the tags.
>
> The problem has been reported by Joey Hess through
>  http://bugs.debian.org/456035
>
> Signed-off-by: Gerrit Pape <pape@smarden.org>
> ---
>  git-pull.sh |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/git-pull.sh b/git-pull.sh
> index 698e82b..43be0bd 100755
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -112,6 +112,11 @@ case "$merge_head" in
>  	     exit 1;;
>  	  *) exit $?;;
>  	esac
> +	# exit if only tags have been fetched
> +	not_for_merge=$(sed -e '/	not-for-merge	tag/d' \
> +			"$GIT_DIR"/FETCH_HEAD)
> +	test "$not_for_merge" != '' || exit 0
> +
>  	curr_branch=${curr_branch#refs/heads/}
>  
>  	echo >&2 "You asked me to pull without telling me which branch you"

I've seen this patch on this list in the past, but isn't "git pull -t" a user-error?

Previous: Gerrit PapeNext: Gerrit Pape
Message 2 of 9 in “git-pull: don't complain about branch merge config if only fetching tags”
  1. git-pull: don't complain about branch merge config if only fetching tagsGerrit Pape, Dec 21, 2007
  2. Junio C HamanoDec 21, 2007
  3. Gerrit PapeDec 27, 2007
  4. Junio C HamanoDec 27, 2007
  5. git-pull: warn if only fetching tags with the -t switchGerrit Pape, Dec 27, 2007
  6. Junio C HamanoDec 28, 2007
  7. Junio C HamanoDec 28, 2007
  8. Daniel BarkalowDec 28, 2007
  9. Junio C HamanoDec 28, 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.