git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Steffen Prohaska <prohaska@zib.de>
Cc: Peter Baumann <waste.manager@gmx.de>,
	Andreas Ericsson <ae@op5.se>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Jakub Narebski <jnareb@gmail.com>,
	Federico Mena Quintero <federico@novell.com>,
	git@vger.kernel.org
Subject: Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued
Date: Thu, 25 Oct 2007 11:27:56 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0710251117310.25221@racer.site> (raw)
In-Reply-To: <79366145-3C91-4417-B62C-FFF9EC452076@zib.de>

Hi,

On Thu, 25 Oct 2007, Steffen Prohaska wrote:

> On Oct 25, 2007, at 1:28 AM, Johannes Schindelin wrote:
> 
> > On Thu, 25 Oct 2007, Steffen Prohaska wrote:
> > 
> > > On Oct 25, 2007, at 12:14 AM, Johannes Schindelin wrote:
> > > 
> > > > But I think I have to drive my message home again: if what you 
> > > > desire becomes reality, you take away the clear distinction 
> > > > between local and remote branches.  In fact, those branches are 
> > > > neither local (because the next pull will automatically update 
> > > > them with remote changes, but _only_ if they fast-forward) nor 
> > > > remote (because you plan to work on them locally).
> > > 
> > > Exactly, because I do not work on those branches alone. These are 
> > > _shared_ branches. I can work on such a branch with a group of 
> > > developers. I'm willing to accept this bit of chaos.
> > 
> > It is not just a chaos.  I see a serious problem here.  On _your_ 
> > computer, you do _not_ have a shared branch.  Which is visible _even_ 
> > in your modified work flow when you have unpushed changes.
> > 
> > So your desired illusion that your local branches are anything but 
> > local branches will never be perfect enough.
> 
> Ok, there is not a fundamental difference between local branches
> that automatically merge from remotes and local branches that
> are purely local and _never_ merge anything automatically. Both
> are only local branches.

Actually, not really.  For refs/remotes/* you expect them to change 
possibly at the same time.  For your local branches, I'd expect them only 
to change when I am actually working on them (and yes, that includes a 
pull into the current branch).

> > > Your rebase workflow is not possible if more than one dev wants to 
> > > work on the topic branch together.
> > 
> > Why not?  I do it all the time.  CVS users do it all the time, for 
> > that matter.
> 
> You're right. You can rebase your local changes on top of the new shared 
> remote head. And this is probably the best thing you can do to get a 
> clean history. Maybe it should be easier.

It should.  Thus my question about best practices (which is technically in 
this thread, but we are in a subthread which permuted into "I want git 
pull to behave differently")

I _want_ this to be easier.

> So, do I understand correctly, what you propose is:
> - never merge but only rebase
> - Due to lacking support for this in "git pull", never use
>  git pull when working with shared branches but instead _always_ use
>  "git fetch; git rebase origin/<branch_I'm_on>".
> 
> So you say that one of the first messages in "git for CVS users", "The 
> equivalent of cvs update is git pull origin" [1], is wrong. I don't 
> think I'm able to sell your proposed workflow with the current 
> documentation. But maybe I try if I'm absolutely convinced that it is 
> superior.

Hehe.  You just experienced the tremendous speed at which git moves.  In 
the beginning, we really thought that "git pull" is all you'll ever want 
to have.

But in the meantime, one of the biggest Enemies of the Rebase (yours 
truly) converted to an avid fan of it, because it really helps 
development.  It also makes for clean history, which is always good.

> > > > But here is a proposal which should make you and your developers 
> > > > happy, _and_ should be even easier to explain:
> > > > 
> > > > Work with topic branches.  And when you're done, delete them.
> > > 
> > > Again, if you want to share the topic branch the situation gets more 
> > > complex.
> > 
> > Hardly so.  In my proposed solution to your problem, there is nothing 
> > which prevents you from working off of another branch than "master".
> 
> Well if you have several local branches checked out that are
> shared with others you run into the "git push" problem again ...
> (see below at git push origin master).

Do the same as I, always say "git push origin master" (of course, you 
should exchange "master" with whatever branch you want to push).  Be 
precise.

> > > > So the beginning of the day could look like this:
> > > > 
> > > > 	git fetch
> > > > 	git checkout -b todays-topic origin/master
> > > > 
> > > > 	[hack hack hack]
> > > > 	[test test test]
> > > > 	[debug debug debug]
> > > > 	[occasionally commit]
> > > > 	[occasionally git rebase -i origin/master]
> > > > 
> > > > and the end of the topic
> > > > 
> > > > 	git branch -M master
> 
> Isn't this a bit dangerous? It forces to overwrite master no matter 
> what's on it. You don't see diffstats nor a fast forward message that 
> confirms what you're doing.

Yeah, I should have said something like "git branch -m master" 
(implicitely assuming that you have no current "master" branch).

> > > > 	git push origin master
> 
> I'd like to see "git push" here.

I think it is not asking too much for the user to be a bit more precise.  
If you really do not trust your developers to be capable of that, point 
them to git gui.

>    git branch -m <shared_branch>
>    git push origin <shared_branch>
>    git checkout do-not-work-here
>    git branch -D <shared_branch>

Actually, the last two commands would better be

	git checkout HEAD^{commit}
	git branch -d <shared_branch>

> > The problem I see here: you know git quite well.  Others don't, and 
> > will be mightily confused why pull updates local branches sometimes, 
> > and sometimes not.
> 
> But it already happens now. "git pull" sometimes merges a remote branch 
> (--track) and sometimes it reports an error that is fails to do so 
> (--no-track).

If there really is an inconsistent behaviour, then we'll have to fix that.  
We should not introduce inconsistent behaviour on top of that.

Ciao,
Dscho

  reply	other threads:[~2007-10-25 10:28 UTC|newest]

Thread overview: 161+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08 20:55 Git User's Survey 2007 unfinished summary continued Jakub Narebski
2007-10-12 22:08 ` Jakub Narebski
2007-10-12 23:36   ` Frank Lichtenheld
2007-10-13  0:46   ` Johannes Schindelin
2007-10-13  2:13     ` J. Bruce Fields
2007-10-13  2:53     ` Shawn O. Pearce
2007-10-13 12:58     ` Frank Lichtenheld
2007-10-13 13:04       ` Johannes Schindelin
2007-10-13 18:00     ` Andreas Ericsson
2007-10-13 19:59     ` David Kastrup
2007-10-13 20:27       ` J. Bruce Fields
2007-10-13 20:57         ` David Kastrup
2007-10-14  0:36         ` Johannes Schindelin
2007-10-14  1:13           ` Linus Torvalds
2007-10-14  1:44             ` Shawn O. Pearce
2007-10-14  3:15               ` Linus Torvalds
2007-10-14  3:43                 ` david
2007-10-14  3:55                   ` Linus Torvalds
2007-10-14 10:20               ` Reece Dunn
2007-10-14 18:12                 ` Steven Grimm
2007-10-14 18:40                   ` J. Bruce Fields
2007-10-14 19:25                     ` Steven Grimm
2007-10-14 19:50                     ` Andreas Ericsson
2007-10-14 20:18                       ` Johannes Schindelin
2007-10-14 20:22                         ` Andreas Ericsson
2007-10-14 20:24                         ` J. Bruce Fields
2007-10-14 19:44                   ` Nicolas Pitre
2007-10-15 23:20                     ` Shawn O. Pearce
2007-10-16  2:48                       ` Nicolas Pitre
2007-10-16 10:51                         ` Johannes Schindelin
2007-10-14  2:06             ` Johannes Schindelin
2007-10-14  8:45               ` Andreas Ericsson
2007-10-14  9:21                 ` David Kastrup
2007-10-14 21:49       ` Jakub Narebski
2007-10-14 22:08         ` Johannes Schindelin
2007-10-14 22:17           ` David Kastrup
2007-10-14 22:12         ` David Kastrup
2007-10-14 22:15           ` Jakub Narebski
2007-10-14 22:23           ` Matthew Andrews
2007-10-14 22:30             ` David Kastrup
2007-10-14 21:10     ` David Tweed
2007-10-19 20:57     ` Federico Mena Quintero
2007-10-19 23:27       ` Jakub Narebski
2007-10-19 23:37       ` Johannes Schindelin
2007-10-22 14:28         ` Federico Mena Quintero
2007-10-20  8:03       ` Andreas Ericsson
2007-10-20 10:19         ` Steffen Prohaska
2007-10-20 11:29           ` Andreas Ericsson
2007-10-21  6:08             ` Dmitry Potapov
2007-10-20 23:06           ` Jakub Narebski
2007-10-20 23:33             ` Johannes Schindelin
2007-10-21  7:17               ` Andreas Ericsson
2007-10-21 22:15                 ` Johannes Schindelin
2007-10-22  7:59                   ` Andreas Ericsson
2007-10-22 11:04                     ` best git practices, was " Johannes Schindelin
2007-10-22 12:44                       ` Andreas Ericsson
2007-10-22 13:48                         ` Johannes Schindelin
2007-10-22 14:31                           ` Andreas Ericsson
2007-10-22 15:00                             ` Johannes Schindelin
2007-10-22 15:16                               ` Andreas Ericsson
2007-10-22 15:42                                 ` Steffen Prohaska
2007-10-22 19:36                                 ` Federico Mena Quintero
2007-10-22 23:21                                   ` Johannes Schindelin
2007-10-25 19:04                                     ` Carl Worth
2007-10-22 23:35                             ` Jakub Narebski
2007-10-23  5:38                               ` Steffen Prohaska
2007-10-23 10:58                                 ` Johannes Schindelin
2007-10-24 18:48                                   ` Steffen Prohaska
2007-10-24 19:20                                     ` J. Bruce Fields
2007-10-24 19:41                                       ` Andreas Ericsson
2007-10-24 19:48                                         ` J. Bruce Fields
2007-10-24 20:12                                           ` Steffen Prohaska
2007-10-24 20:33                                             ` J. Bruce Fields
2007-10-24 21:06                                               ` Andreas Ericsson
2007-10-24 21:20                                                 ` J. Bruce Fields
2007-10-24 21:28                                                 ` Peter Baumann
2007-10-24 21:47                                                   ` Steffen Prohaska
2007-10-24 22:14                                                     ` Johannes Schindelin
2007-10-24 22:33                                                       ` Steffen Prohaska
2007-10-24 22:38                                                         ` J. Bruce Fields
2007-10-24 22:51                                                           ` Steffen Prohaska
2007-10-24 23:28                                                         ` Johannes Schindelin
2007-10-25  6:02                                                           ` Steffen Prohaska
2007-10-25 10:27                                                             ` Johannes Schindelin [this message]
2007-10-25 12:04                                                               ` Steffen Prohaska
2007-10-25  7:15                                                           ` Andreas Ericsson
2007-10-25  7:31                                                             ` Peter Baumann
2007-10-25  7:57                                                               ` Andreas Ericsson
2007-10-25  8:25                                                                 ` Steffen Prohaska
2007-10-25 10:17                                                             ` Johannes Schindelin
2007-10-25 10:33                                                               ` Andreas Ericsson
2007-10-25 12:09                                                                 ` Steffen Prohaska
2007-10-25 12:58                                                                 ` Johannes Schindelin
2007-10-25 13:24                                                                 ` Theodore Tso
2007-10-25 14:58                                                                   ` Andreas Ericsson
2007-10-25 15:21                                                                     ` Theodore Tso
2007-10-25 17:05                                                                       ` Andreas Ericsson
2007-10-25 18:33                                                                         ` Junio C Hamano
2007-10-25 20:18                                                                           ` Andreas Ericsson
2007-10-26  6:18                                                                             ` Steffen Prohaska
2007-10-26  7:53                                                                               ` Andreas Ericsson
2007-10-25 18:02                                                                       ` best git practices, was Re: Git User's Survey 2007 unfinishedsummary continued Federico Mena Quintero
2007-10-25 18:04                                                                         ` Mike Hommey
2007-10-25 18:18                                                                           ` J. Bruce Fields
2007-10-25 18:23                                                                         ` Theodore Tso
2007-10-25 20:08                                                                         ` Andreas Ericsson
2007-10-26 20:01                                                                         ` David Kastrup
2007-10-25 16:06                                                       ` Federico Mena Quintero
2007-10-25 16:38                                                         ` J. Bruce Fields
2007-10-25 18:06                                                           ` Federico Mena Quintero
2007-10-25 18:16                                                             ` J. Bruce Fields
2007-10-25 20:19                                                             ` Andreas Ericsson
2007-10-25 20:27                                                               ` J. Bruce Fields
2007-10-26  9:17                                                                 ` David Kastrup
2007-10-26  4:41                                                         ` [PATCH] Make rebase smarter Steven Walter
2007-10-26  7:42                                                           ` Andreas Ericsson
2007-10-26  9:57                                                           ` Johannes Schindelin
2007-10-26 21:02                                                           ` Junio C Hamano
2007-10-26 23:13                                                             ` Johannes Schindelin
2007-10-26 23:29                                                               ` Junio C Hamano
2007-10-24 21:54                                                   ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Andreas Ericsson
2007-10-24 22:17                                                     ` Johannes Schindelin
2007-10-25  8:07                                                       ` Andreas Ericsson
2007-10-25 10:12                                                         ` Johannes Schindelin
2007-10-25 10:24                                                           ` Andreas Ericsson
2007-10-25 11:39                                                             ` Johannes Schindelin
2007-10-25 12:46                                                               ` Andreas Ericsson
2007-10-25 14:51                                                                 ` Karl Hasselström
2007-10-25 17:10                                                                   ` Andreas Ericsson
2007-10-25  7:26                                                     ` Peter Baumann
2007-10-24 21:16                                               ` Steffen Prohaska
2007-10-24 20:13                                           ` Andreas Ericsson
2007-10-24 23:48                                         ` Jakub Narebski
2007-10-25  7:42                                           ` Andreas Ericsson
2007-10-25 10:07                                             ` Johannes Schindelin
2007-10-25 10:39                                               ` Steffen Prohaska
2007-10-25 16:16                                           ` Federico Mena Quintero
2007-10-23  7:24                               ` Andreas Ericsson
2007-10-22 18:06                           ` Daniel Barkalow
2007-10-22 13:17                       ` Wincent Colaiuta
2007-10-22 13:33                         ` David Symonds
2007-10-22 13:38                         ` Johannes Schindelin
2007-10-22 17:48                           ` Robin Rosenberg
2007-10-23 22:13                         ` Alex Riesen
2007-10-22 13:36                       ` Nguyen Thai Ngoc Duy
2007-10-22 15:24                       ` best git practices, was Re: Git User's Survey 2007 unfinished summarycontinued Federico Mena Quintero
2007-10-24  2:06                       ` best git practices, was Re: Git User's Survey 2007 unfinished summary continued Jakub Narebski
2007-10-24 10:29                         ` Karl Hasselström
2007-10-24 11:04                           ` Jakub Narebski
2007-10-24 11:31                             ` Karl Hasselström
2007-10-24 23:27                               ` Jakub Narebski
2007-10-25  6:10                                 ` Karl Hasselström
2007-10-24 13:15                             ` Catalin Marinas
2007-10-22 12:26                     ` Jakub Narebski
2007-10-22 13:45                       ` Johannes Schindelin
2007-10-22 14:29                       ` Andreas Ericsson
2007-10-22 14:53                     ` Federico Mena Quintero
2007-10-22 23:27                       ` Jakub Narebski
2007-10-22 22:53                   ` Steven Grimm
2007-10-21 22:12           ` J. Bruce Fields
2007-10-13  3:04   ` Shawn O. Pearce

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0710251117310.25221@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=ae@op5.se \
    --cc=bfields@fieldses.org \
    --cc=federico@novell.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=prohaska@zib.de \
    --cc=waste.manager@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).