git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Ingo Brueckl <ib@wupperonline.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	git@vger.kernel.org
Subject: Re: question concerning branches
Date: Thu, 20 Aug 2009 07:59:50 -0700 (PDT)	[thread overview]
Message-ID: <m3y6pemsyl.fsf@localhost.localdomain> (raw)
In-Reply-To: <4A8D53F3.3050500@viscovery.net>

Johannes Sixt <j.sixt@viscovery.net> writes:

> Ingo Brueckl schrieb:

> > In a branch, I learned, I have to commit or stash before I return to master
> > for push/pull to follow the project. If I forget, I'm screwed, because files
> > have changed due to the rewrite (in that branch), I won't get a warning until
> > my first commit (in that branch) and commits (in master) will conflict.

Errr... if having unknown files in status info when comitting doesn't
clue you in that you have spurious uncomitted changes, 

  # On branch master
  # Changes to be committed:
  #   (use "git reset HEAD <file>..." to unstage)
  #
  #       modified:   somefile

and neither commit diff summary

   n files changed, kk insertions(+), ll deletions(-)

doesn't clue you in, then you have more serous problems!


Second, you can use git-aware prompt to tell you if you have
uncomitted changes, so you will know when switching branches that you
have some changes that don't belong to branch you switch from.

> 
> You are obviously of a CVS or SVN mindset, where making a commit is such
> an important operation that you don't dare to make it until your work is
> *completed*.
> 
> With a git mindset, it won't happen that you "forget" whether you have
> anything uncommitted; you simply never have because committing half-baked
> stuff is the rule, not the exception. That is, before you get a cup of
> coffee, you commit; before you answer a phone call, you commit; before you
> turn your attention away, you commit. (That may be exaggerated, perhaps it
> even isn't, but you get the point.)
> 
> When you have completed your work, you go back to make your commit history
> look nice, comprehensible, and bisectable.

...with "git rebase --interactive" or patch management interface
(StGit, Guilt), or topic branch management interface (TopGit).

> 
> And only then comes the heavy operation: You publish your work for
> consumption by interested parties. This may be even only you yourself:
> "Consumption" would be to merge the work into your release branch. This is
> the right time to care about upstream again.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2009-08-20 15:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19 17:33 question concerning branches Ingo Brueckl
2009-08-19 18:07 ` Bruce Stephens
2009-08-19 18:07 ` Avery Pennarun
2009-08-19 18:31   ` Ingo Brueckl
2009-08-19 19:08     ` Jakub Narebski
2009-08-19 19:45       ` Ingo Brueckl
2009-08-19 19:50         ` Avery Pennarun
2009-08-20  7:57           ` Matthieu Moy
2009-08-19 19:53         ` Jacob Helwig
2009-08-19 20:01         ` Jakub Narebski
2009-08-19 20:39         ` Theodore Tso
2009-08-19 20:57           ` Jakub Narebski
2009-08-20 17:37             ` Theodore Tso
2009-08-19 21:51         ` Linus Torvalds
2009-08-20  3:01           ` Randal L. Schwartz
2009-08-20 12:46           ` Ingo Brueckl
2009-08-20 13:47             ` Johannes Sixt
2009-08-20 14:59               ` Jakub Narebski [this message]
2009-08-19 18:35 ` Junio C Hamano
2009-08-19 19:21   ` Ingo Brueckl
2009-08-20  7:33     ` Andreas Ericsson

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

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

  git send-email \
    --in-reply-to=m3y6pemsyl.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ib@wupperonline.de \
    --cc=j.sixt@viscovery.net \
    --cc=torvalds@linux-foundation.org \
    /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.
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 NNTP newsgroup(s).