Re: aborted 'git fetch' leaves workspace unusable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> stephen_leake@xxxxxxxxxxxxxxxx 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.

Ok; backwards compatibility is important.

Perhaps FETCH_HEAD could be copied to FETCH_HEAD_prev or some such, to
allow recovering in an error case?

-- 
-- Stephe
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]