public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: stephen_leake@stephe-leake•org
Cc: <git@vger•kernel.org>
Subject: Re: aborted 'git fetch' leaves workspace unusable
Date: Thu, 02 Jan 2014 10:09:45 -0800	[thread overview]
Message-ID: <xmqqbnzuqmqe.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <32eeea08963ec4438f97ff9ef6553a75@stephe-leake.org> (stephen leake's message of "Tue, 31 Dec 2013 01:19:25 -0700")

stephen_leake@stephe-leake•org writes:

> However, in this case, even running the fetch was a mistake; I would
> have prefered that it leave FETCH_HEAD in its previous state.

I think the clearing of leftover FETCH_HEAD is one of the early
things "git fetch" does, unless "--append" is in effect.  I haven't
looked at the code for a long time, but it may be possible to move
the logic of doing so around so that this clearing is done as lazily
as possible.

I however suspect that such a change may have fallouts on other
people who are writing tools like yours; they may be depending on
seeing FETCH_HEAD cleared after a failed fetch, and be surprised to
see a stale contents after they (attempt to) run "git fetch" in it.

So it is not so clear if it is a good thing to change the behaviour
of "git fetch" not to touch FETCH_HEAD upon a failure.

  reply	other threads:[~2014-01-02 18:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-31  8:19 aborted 'git fetch' leaves workspace unusable stephen_leake
2014-01-02 18:09 ` Junio C Hamano [this message]
2014-01-03  3:28   ` Stephen Leake
2014-01-03 17:58     ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2013-12-30 17:07 stephen_leake
2013-12-30 19:37 ` Junio C Hamano
2013-12-30 19:54 ` Torsten Bögershausen

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=xmqqbnzuqmqe.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=stephen_leake@stephe-leake$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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