From: Jon Seymour <jon.seymour@gmail.com>
To: Peter Baumann <waste.manager@gmx.de>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH 00/23] RFC: Introducing git-test, git-atomic, git-base and git-work
Date: Sun, 24 Apr 2011 03:16:33 +1000 [thread overview]
Message-ID: <BANLkTinhjMtNc257NnOCZe6askr2i=4g6Q@mail.gmail.com> (raw)
In-Reply-To: <20110423091300.GC9206@m62s10.vlinux.de>
On Saturday, April 23, 2011, Peter Baumann <waste.manager@gmx.de> wrote:
> On Sat, Apr 23, 2011 at 05:22:29PM +1000, Jon Seymour
> git checkout master
> git merge debug topic1 topic2 topic3
> ... compile ... deploy ... test
>
> . - q - q -. <- topic3
> / \
> . -s - s - s ---. \ <- topic2
> / \|
> / t - t - t - - -\ <- topic1
> / / m <- master
> / / / |
> o - o - o - o - o - o - o | <- remotes/trunk
> \ /
> d - d - - <- debug
>
> Having fond a small error, I can't commit it directly on the merge m, because
> It is actually a fix a topic branch. Running git checkout topicX before doing
> any change is also not an option, because I often forget to checkout the topic
> before commiting. And rebasing afterwards is also not that easy, because there
> is merge m in between. So this isn't what I actually use, but would be *iff*
> there where some sort of tool support to help me.
>
> What I end up doing is the following:
>
> - o - o <- remotes/trunk
> \
> d - d <- debug
> \
> t - t -t <- topic1
> \
> s - s -s <- topic2
> \
> q - q <- topic3, master
>
>
> The topic branches are just there for illustration, I normally do not track
> those explicitly with git branches, as master is rebase often on top of trunk,
> thanks to git-svn. Now if I do want to commit a topic branch to SVN, I rebase
> so that my history is now trunk - topic1 - debug - topic2 - topic3, master
> and then run git checkout topic1; git svn dcommit to make sure only the commits
> in topic1 are commited.
>
> All in all, this workflow is not perfect, but at least it sort of works.
>
> Now back to my initial question:
> Could your new "git work" command help me to adjust my workflow and ease the pain?
>
> > Peter
>
Hi Peter,
Yes, git work is good for this use case.
You would tend to manage you master branch as in your first diagram above.
Suppose you found a problem on topicX. So, you fix the issue inplace
on the top of your master that includes all 5 dependencies. Call this
commit m'.
You have decided that the fix really belongs on topic2. So what you do is:
git work update topic2 HEAD~1
This will move that commit onto the tip of topic2 (producing topic2'),
merge that into m (producing m''), and reset master to m''.
One thing to note is that you never share master. It will be a merge
hell. You only ever share topics when they become stable.
As the trunk gets updated you do:
git work merge remotes/trunk
It will merge remotes/trunk into the base of your unpublished work,
then rebase your unpublished work onto that merge.
git work is also excellent for keeping your debug branch available in
your working tree but isolated from your topics.
Things get little tricker when you have a commit that spans multiple
topics. However, there is a straight forward methodology for managing
such issues. There are also techniques for dealing with conflicts with
any dependency, especially remotes/trunk which I can explain in
another note if there is interest.
Jon.
next prev parent reply other threads:[~2011-04-23 17:16 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-23 7:22 [PATCH 00/23] RFC: Introducing git-test, git-atomic, git-base and git-work Jon Seymour
2011-04-23 7:22 ` [PATCH 01/23] Introduce git-test.sh and git-test-lib.sh Jon Seymour
2011-04-27 19:11 ` Drew Northup
2011-04-23 7:22 ` [PATCH 02/23] Introduce --unstaged Jon Seymour
2011-04-23 7:22 ` [PATCH 03/23] Introduce --staged Jon Seymour
2011-04-23 7:22 ` [PATCH 04/23] Introduce --untracked Jon Seymour
2011-04-23 7:22 ` [PATCH 05/23] Introduce --conflicted Jon Seymour
2011-04-23 7:22 ` [PATCH 06/23] Introduce --rebasing Jon Seymour
2011-04-23 7:22 ` [PATCH 07/23] Introduce --detached Jon Seymour
2011-04-23 7:22 ` [PATCH 08/23] Introduce --branch-exists Jon Seymour
2011-04-23 7:22 ` [PATCH 09/23] Introduce --tag-exists Jon Seymour
2011-04-23 7:22 ` [PATCH 10/23] Introduce --ref-exists Jon Seymour
2011-04-23 7:22 ` [PATCH 11/23] Introduce --commit-exists Jon Seymour
2011-04-23 7:22 ` [PATCH 12/23] Introduce --checked-out Jon Seymour
2011-04-23 7:22 ` [PATCH 13/23] Introduce --reachable Jon Seymour
2011-04-23 7:22 ` [PATCH 14/23] Introduce --tree-same Jon Seymour
2011-04-23 7:22 ` [PATCH 15/23] Introduce --same Jon Seymour
2011-04-23 7:22 ` [PATCH 16/23] misc Jon Seymour
2011-04-23 7:22 ` [PATCH 17/23] whitespace fix Jon Seymour
2011-04-23 7:22 ` [PATCH 18/23] tests --conflicted Jon Seymour
2011-04-23 7:22 ` [PATCH 19/23] rebasing: add tests Jon Seymour
2011-04-23 7:22 ` [PATCH 20/23] test: git test cleanups Jon Seymour
2011-04-23 7:22 ` [PATCH 21/23] Introduce git-atomic Jon Seymour
2011-04-23 7:22 ` [PATCH 22/23] Introduce git base Jon Seymour
2011-04-23 7:22 ` [PATCH 23/23] Introduce support for the git-work command Jon Seymour
2011-04-23 9:13 ` [PATCH 00/23] RFC: Introducing git-test, git-atomic, git-base and git-work Peter Baumann
2011-04-23 17:16 ` Jon Seymour [this message]
2011-04-23 18:37 ` Jon Seymour
2011-04-24 15:47 ` Jon Seymour
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='BANLkTinhjMtNc257NnOCZe6askr2i=4g6Q@mail.gmail.com' \
--to=jon.seymour@gmail.com \
--cc=git@vger.kernel.org \
--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.
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).