Re: [PATCH 4/4] builtin-remote: add set-head verb

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Also it may be better to be more explicit about both the syntax and the
> semantics of `<branch>`.  Do you expect "refs/remotes/<name>/master" or
> just "master" (I assume the latter)?  Is it an error if the branch does
> not exist in the specified hierarchy?  Can you force to set to a branch
> that does not exist in your tracking side (yet) but you know exists on the
> remote side already?

A few things I forgot (and before I go to bed).

If remotes/<name>/HEAD already points at a branch frotz, and you peek the
remote (i.e. you do not actually run "fetch" to download objects, but just
"ls-remote" it) and find out that "HEAD" does not point at the same commit
as "frotz" but it now points at the same commit as another branch
"nitfol", you probably would want to update it to point at "nitfol", but
it was unclear from the description in the documentation if this option
was meant to perform this kind fo update, or only to set a missing HEAD.

If you meant to do an update, there is one thing to watch out for when you
reuse the logic used by clone.  It favors "master" if more than one
branches point at the same commit as HEAD.  You need to customize it to
favor the one that the HEAD points at on the local side before you start
(iow, try to keep the current value when you can).

For example, if it points at "frotz" locally when the command was started,
and you found out that HEAD now points at the commit at the tip of "frotz"
and "master" branches by peeking, you do not want to repoint HEAD from
"frotz" to "master".
--
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]

  Powered by Linux