Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued

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

 



On 10/22/07, Andreas Ericsson <ae@xxxxxx> wrote:
> Johannes Schindelin wrote:
>> On Mon, 22 Oct 2007, Andreas Ericsson wrote:
>>
>>> If I were to suggest any improvements, it'd be to change the semantics of
>>> git-pull to always update the local branches set up to be merged with the
>>> remote tracking branches when they, prior to fetching, pointed to the same
>>> commit, such that when
>>>
>>> $ git show-ref master
>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
>>> d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master
>>>
>>> refs/heads/master gets set to refs/remotes/origin/master post-fetch.
>>
>> In general, this should fail.  Because you are expected to have local
>> changes in the local branches.
>
>
> BS argument. Git knows when I haven't got any changes on my local
> branches, and it can be fairly safely assumed that when I feel like
> making any, I'd like to make them off as fresh a tip as possible unless
> I explicitly tell git otherwise.
[cut]

It would be I think possible to make git behave as you want, although I'd rather
(at least at first) have behaviour described above turned on by some option
or config variable. I guess that it would be not that hard to make script to do
what you ant (and probably it would be best if you tried your idea that way).

There are the following caveats.
1. For each local branch that is to be updated on pull, this branch
must be marked as tracking some branch of some repository. This has to
be explicitely done; for example by creating those branches using
--track option.
2. Git can do a merge with conflicts _only_ if that branch is checked
out. So for all local branches which you want to get updated using
"git pull --update-all <repo>" (or something like that), the merge
with remote branch should be either fast-forward, trivial merge, or
merge without conflicts. "git pull --update-all <repo>" would return
then list of updated branches and list of branches which cannot be
updated.

So... are you going to try to implement that?
-- 
Jakub Narebski
-
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