From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
Johannes Sixt <j6t@kdbg.org>,
git@vger.kernel.org
Subject: Re: FETCH_HEAD files and mirrored repos
Date: Mon, 13 Jul 2020 16:22:11 -0400 [thread overview]
Message-ID: <20200713202211.GA2355588@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqtuybmba1.fsf@gitster.c.googlers.com>
On Mon, Jul 13, 2020 at 01:04:54PM -0700, Junio C Hamano wrote:
> Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
>
> > Does it make sense to add logic for whether this is done in a bare repo?
> > I can't imagine common cases where a FETCH_HEAD would be useful outside
> > of a checkout where a merge is likely to happen.
>
> It is entirely valid to respond to a one-shot "My work is published
> there; could you see if I am doing anything obviously wrong?" with
>
> git fetch git://k.org/somebody/linux.git check-me-please
> git log ..FETCH_HEAD
> git diff ...FETCH_HEAD
>
> i.e. without touching any of our refs, and possibly in a bare
> repository, no?
I occasionally use FETCH_HEAD for such things. If we were to stop
writing it automatically, I think the key thing to notice is whether the
result was actually stored anywhere else. Or more accurately, whether
the user asked for any refspecs on the command line (since we'd still
update tracking refs in some cases).
If I do:
git fetch
or:
git fetch origin refs/heads/foo:refs/heads/foo
then I probably don't care about FETCH_HEAD. But if I do:
git fetch origin refs/heads/foo
then I'm probably interested in picking the result out of FETCH_HEAD.
-Peff
next prev parent reply other threads:[~2020-07-13 20:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-11 20:48 FETCH_HEAD files and mirrored repos Konstantin Ryabitsev
2020-07-11 21:07 ` Junio C Hamano
2020-07-11 21:19 ` Konstantin Ryabitsev
2020-07-12 17:33 ` Junio C Hamano
2020-07-12 20:25 ` Konstantin Ryabitsev
2020-07-12 20:52 ` Junio C Hamano
2020-07-12 21:54 ` Konstantin Ryabitsev
2020-07-13 17:09 ` Johannes Sixt
2020-07-13 17:13 ` Junio C Hamano
2020-07-13 18:06 ` [PATCH] fetch: optionally allow disabling FETCH_HEAD update Junio C Hamano
2020-07-13 19:08 ` Taylor Blau
2020-07-13 19:45 ` Junio C Hamano
2020-07-13 20:00 ` FETCH_HEAD files and mirrored repos Konstantin Ryabitsev
2020-07-13 20:04 ` Junio C Hamano
2020-07-13 20:22 ` Jeff King [this message]
2020-07-13 20:34 ` Konstantin Ryabitsev
2020-07-13 20:50 ` Jeff King
2020-07-13 20:43 ` Johannes Sixt
2020-07-14 4:11 ` Jonathan Nieder
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=20200713202211.GA2355588@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=konstantin@linuxfoundation.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 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 NNTP newsgroup(s).