login
Header Space

 
 

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

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Schindelin <Johannes.Schindelin@...>
Cc: Jakub Narebski <jnareb@...>, Andreas Ericsson <ae@...>, Federico Mena Quintero <federico@...>, <git@...>
Date: Wednesday, October 24, 2007 - 2:48 pm

On Oct 23, 2007, at 12:58 PM, Johannes Schindelin wrote:


I try to explain the workflow that I'd use the feature for.
Maybe an easier setup could be used to achieve the same.
Any suggestions for a simpler setup are welcome.

The workflow is used by a group of developers that all have
access to a shared repository. One major goal is to keep the
setup for most developers simple. They are new to git and
as few commands as possible should be sufficient to start
working. Besides the typical stable branches (master, next)
shared topic branches should be available that can be used
to develop and review features before they are merged to the
stable branches. Patches are not send by email.

So here's the setup:

The central shared repo is called project-shared.git and contains,
for example, the following branches:
    master
    next
    work/topicA
    work/topicB
    ...


Developers clone the repo and check out the branches they are
interested in. For example a developer may want to track next
and work on topicB:

    git clone ssh://central.example.com/project-shared.git project
    cd project
    git checkout -b next origin/next
    git checkout -b work/topicB origin/work/topicB

This is sufficient. No adding of remotes is needed. Neither
is a private repository on a server required. After cloning,
developers have all they need.

Later work/topicB has new commits and should be pushed:

    git push origin

The default behaviour of push is fine. Only matching branches
are pushed.

_But_, origin is a shared repository. Therefore branches may
have advanced and git push may report

error: remote 'refs/heads/next' is not a strict subset of local ref  
'refs/heads/next'. maybe you are not up-to-date and need to pull first?

So here's the problem. The developer didn't do anything wrong.
But git complaints with an error. Git also recommends to run
pull, so the developer runs "git pull". But this doesn't help,
because it's only updating work/topicB and "git push" will
complain with the very same error.

What you need to do is

    git checkout <local-branch>
    git pull
    git checkout <local-branch2>
    git pull
    ...

for every local branch.

This is absolutely stupid. Therefore the developer starts
to hate git, or she just starts to ignore the errors because
they don't have a real meaning most of the times. And later,
when the error could be helpful she would ignore it, too.

The problem described can only happen with a shared repository.
In a workflow that pulls from read-only repos and pushes to a
private repo that is read-only for others, such a problem cannot
happen. Because in a non-shared repository the branches cannot
be advanced by others. But in a shared repository they can.

I see two reasonable solutions:
1) "git push" only pushes the current branch.
2) "git pull" pulls all branches as proposed by Andreas.

Maybe something that I don't see is fundamentally wrong with
the setup.

Johannes, you mentioned that it is essential to distinguish
remote branches from local branches. In general, I agree. The
problem described above is 'smaller' if you have less local
branches that you're not actively working on. But I believe
it is reasonable to have more than one of them. The remotes
track everything and your local branches are a subset of things
you're interested in although you're not working on each of
the branch every day. I don't think it's reasonable to delete
a local branch immediately each time you stopped working on it.

I think root of the problem is that git is more focused on
pulling from read-only and pushing to non-shared repos. The
support for shared repos needs to be improved before it
is perfect.

	Steffen










-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Mon Oct 8, 4:55 pm)
Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Fri Oct 12, 6:08 pm)
Re: Git User's Survey 2007 unfinished summary continued, Shawn O. Pearce, (Fri Oct 12, 11:04 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Fri Oct 12, 8:46 pm)
Re: Git User's Survey 2007 unfinished summary continued, Federico Mena Quintero, (Fri Oct 19, 4:57 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sat Oct 20, 4:03 am)
Re: Git User's Survey 2007 unfinished summary continued, Steffen Prohaska, (Sat Oct 20, 6:19 am)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Sun Oct 21, 6:12 pm)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Sat Oct 20, 7:06 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sat Oct 20, 7:33 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sun Oct 21, 3:17 am)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sun Oct 21, 6:15 pm)
Re: Git User's Survey 2007 unfinished summary continued, Steven Grimm, (Mon Oct 22, 6:53 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Mon Oct 22, 3:59 am)
Re: Git User's Survey 2007 unfinished summary continued, Federico Mena Quintero, (Mon Oct 22, 10:53 am)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Mon Oct 22, 7:27 pm)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Mon Oct 22, 8:26 am)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Mon Oct 22, 10:29 am)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Mon Oct 22, 9:45 am)
best git practices, was Re: Git User's Survey 2007 unfinishe..., Johannes Schindelin, (Mon Oct 22, 7:04 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Mon Oct 22, 11:24 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Nguyen Thai Ngoc Duy, (Mon Oct 22, 9:36 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Mon Oct 22, 9:38 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Mon Oct 22, 9:48 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Andreas Ericsson, (Mon Oct 22, 10:31 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Tue Oct 23, 6:58 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Steffen Prohaska, (Wed Oct 24, 2:48 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Thu Oct 25, 12:16 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 6:07 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Wed Oct 24, 6:17 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 6:12 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 7:39 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Wed Oct 24, 6:14 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Thu Oct 25, 12:06 pm)
[PATCH] Make rebase smarter, Steven Walter, (Fri Oct 26, 12:41 am)
Re: [PATCH] Make rebase smarter, Johannes Schindelin, (Fri Oct 26, 5:57 am)
Re: [PATCH] Make rebase smarter, Andreas Ericsson, (Fri Oct 26, 3:42 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Thu Oct 25, 2:06 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Wed Oct 24, 7:28 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 6:17 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Andreas Ericsson, (Thu Oct 25, 10:58 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Thu Oct 25, 2:02 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 8:58 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 6:27 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Mon Oct 22, 11:00 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Andreas Ericsson, (Mon Oct 22, 11:16 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Mon Oct 22, 3:36 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Mon Oct 22, 7:21 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Steffen Prohaska, (Mon Oct 22, 11:42 am)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sat Oct 20, 7:29 am)
Re: Git User's Survey 2007 unfinished summary continued, Dmitry Potapov, (Sun Oct 21, 2:08 am)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Fri Oct 19, 7:37 pm)
Re: Git User's Survey 2007 unfinished summary continued, Federico Mena Quintero, (Mon Oct 22, 10:28 am)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Fri Oct 19, 7:27 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sat Oct 13, 3:59 pm)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Sun Oct 14, 5:49 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sun Oct 14, 6:12 pm)
Re: Git User's Survey 2007 unfinished summary continued, Matthew Andrews, (Sun Oct 14, 6:23 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sun Oct 14, 6:30 pm)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Sun Oct 14, 6:15 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sun Oct 14, 6:08 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sun Oct 14, 6:17 pm)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Sat Oct 13, 4:27 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sat Oct 13, 8:36 pm)
Re: Git User's Survey 2007 unfinished summary continued, Linus Torvalds, (Sat Oct 13, 9:13 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sat Oct 13, 10:06 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sun Oct 14, 4:45 am)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sun Oct 14, 5:21 am)
Re: Git User's Survey 2007 unfinished summary continued, Shawn O. Pearce, (Sat Oct 13, 9:44 pm)
Re: Git User's Survey 2007 unfinished summary continued, Steven Grimm, (Sun Oct 14, 2:12 pm)
Re: Git User's Survey 2007 unfinished summary continued, Nicolas Pitre, (Sun Oct 14, 3:44 pm)
Re: Git User's Survey 2007 unfinished summary continued, Shawn O. Pearce, (Mon Oct 15, 7:20 pm)
Re: Git User's Survey 2007 unfinished summary continued, Nicolas Pitre, (Mon Oct 15, 10:48 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Tue Oct 16, 6:51 am)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Sun Oct 14, 2:40 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sun Oct 14, 3:50 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sun Oct 14, 4:18 pm)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Sun Oct 14, 4:24 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sun Oct 14, 4:22 pm)
Re: Git User's Survey 2007 unfinished summary continued, Steven Grimm, (Sun Oct 14, 3:25 pm)
Re: Git User's Survey 2007 unfinished summary continued, Linus Torvalds, (Sat Oct 13, 11:15 pm)
Re: Git User's Survey 2007 unfinished summary continued, Linus Torvalds, (Sat Oct 13, 11:55 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sat Oct 13, 4:57 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sat Oct 13, 2:00 pm)
Re: Git User's Survey 2007 unfinished summary continued, Frank Lichtenheld, (Sat Oct 13, 8:58 am)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sat Oct 13, 9:04 am)
Re: Git User's Survey 2007 unfinished summary continued, Shawn O. Pearce, (Fri Oct 12, 10:53 pm)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Fri Oct 12, 10:13 pm)
Re: Git User's Survey 2007 unfinished summary continued, Frank Lichtenheld, (Fri Oct 12, 7:36 pm)
speck-geostationary