From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Daniel Barkalow <barkalow@iabervon.org>,
git@vger.kernel.org, gitster@pobox.com, spearce@spearce.org
Subject: Re: [PATCH v2] Fix fetch/pull when run without --update-head-ok
Date: Mon, 13 Oct 2008 07:23:22 -0700 [thread overview]
Message-ID: <7vod1obmlh.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0810131129110.22125@pacific.mpi-cbg.de.mpi-cbg.de> (Johannes Schindelin's message of "Mon, 13 Oct 2008 11:36:52 +0200 (CEST)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Some confusing tutorials suggested that it would be a good idea to fetch
> into the current branch with something like this:
>
> git fetch origin master:master
>
> (or even worse: the same command line with "pull" instead of "fetch").
> While it might make sense to store what you want to pull, it typically
> is plain wrong when the current branch is "master".
>
> As noticed by Junio, this behavior should be triggered by _not_ passing
> the --update-head-ok option, but somewhere along the lines we lost that
> behavior.
Do you mean, by "this behavior should be triggered", "we should allow
updating the current branch head only when --update-head-ok is given", in
other words, "we should error out if the user tries to update the current
head with git-fetch without passing --update-head-ok"?
> NOTE: this patch does not completely resurrect the original behavior
> without --update-head-ok: the check for the current branch is now _only_
> performed in non-bare repositories.
I think that is a sensible improvement.
> Strangely, some more tests refused to pass this time, because they
> did not use --update-head-ok; this was fixed, too.
We need to look at these changes a bit carefully, as changes to existing
tests can be either (1) fixing those that depended on broken behaviour of
the command, or (2) trying to hide regressions introduced by the patch
under the rug.
> t/t5405-send-pack-rewind.sh | 2 +-
> t/t5505-remote.sh | 2 +-
> t/t5510-fetch.sh | 12 ++++++++++++
> t/t9300-fast-import.sh | 2 +-
I suspect all of these offending tests came after b888d61 (Make fetch a
builtin, 2007-09-10) which lacked the necessary check in do_fetch() to
cause the regression you are fixing (iow, I am suspecting that the
brokenness of the tests were hidden by the breakage you are fixing). The
parts of the tests you fixed came from these:
6738c81 (send-pack: segfault fix on forced push, 2007-11-08)
4ebc914 (builtin-remote: prune remotes correctly ..., 2008-02-29)
4942025 (t5510: test "git fetch" following tags minimally, 2008-09-21)
03db452 (Support gitlinks in fast-import., 2008-07-19)
all of which are indeed descendants of b888d61.
With these verified, I think I should move the "Strangely" comment to the
commit log message proper (after stripping "Strangely" part -- it is not
strange anymore after we understand why).
next prev parent reply other threads:[~2008-10-13 14:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-11 11:38 [PATCH] fetch: refuse to fetch into the current branch in a non-bare repository Johannes Schindelin
2008-10-11 21:44 ` Junio C Hamano
2008-10-12 18:47 ` Shawn O. Pearce
2008-10-13 9:28 ` Johannes Schindelin
2008-10-12 18:52 ` Shawn O. Pearce
2008-10-12 20:37 ` Daniel Barkalow
2008-10-13 9:36 ` [PATCH v2] Fix fetch/pull when run without --update-head-ok Johannes Schindelin
2008-10-13 14:09 ` Shawn O. Pearce
2008-10-13 17:57 ` Johannes Schindelin
2008-10-13 14:23 ` Junio C Hamano [this message]
2008-10-13 17:30 ` Junio C Hamano
2008-10-13 18:12 ` Johannes Schindelin
2008-10-13 20:05 ` Daniel Barkalow
2008-10-14 9:49 ` Johannes Schindelin
2008-10-14 15:02 ` Shawn O. Pearce
2008-10-14 16:04 ` Daniel Barkalow
2008-10-14 16:15 ` Johannes Schindelin
2008-10-14 15:57 ` Daniel Barkalow
2008-10-14 16:17 ` Johannes Schindelin
2008-10-14 16:52 ` Daniel Barkalow
2008-10-14 17:02 ` Daniel Barkalow
2008-10-14 22:07 ` Junio C Hamano
2008-10-14 22:53 ` [PATCH] pull: allow "git pull origin $something:$current_branch" into an unborn branch Junio C Hamano
2008-10-13 17:08 ` [PATCH v2] Fix fetch/pull when run without --update-head-ok Daniel Barkalow
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=7vod1obmlh.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/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.