git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nico Williams <nico@cryptonector.com>
To: Tony Finch <dot@dotat.at>
Cc: "Jakub Narębski" <jnareb@gmail.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	"Mike Stump" <mikestump@comcast.net>,
	"git discussion list" <git@vger.kernel.org>
Subject: Re: "Branch objects" (was: Re: cherry picking and merge)
Date: Thu, 7 Aug 2014 12:22:08 -0500	[thread overview]
Message-ID: <20140807172207.GP23449@localhost> (raw)
In-Reply-To: <alpine.LSU.2.00.1408071735410.23775@hermes-1.csi.cam.ac.uk>

On Thu, Aug 07, 2014 at 05:42:34PM +0100, Tony Finch wrote:
> Nico Williams <nico@cryptonector.com> wrote:
> > On Thu, Aug 07, 2014 at 12:38:48PM +0100, Tony Finch wrote:
> > > But [a rebasing workflow] is inconvenient for deploying the patched
> > > version to production (which is the point of developing the fixes) - I
> > > want a fast-forwarding branch for that.
> >
> > I'm not sure I follow this.  You deploy what you build, and you build
> > the HEAD of the production branch, whatever that is.  If it gets
> > rebased, so it it does.
> 
> The problem is that the production branch gets copied around: pushed to
> the repo server, pulled by other team members, etc. Forced pushes
> are accident-prone, as is resetting a rebased branch after a pull.

When I rebase and I need the old HEAD around I do something like this:

$ git checkout $branch_to_rebase
$ ver=${branch_to_rebase##*-}
$ git checkout -b ${branch_to_rebase%-${ver}}-$((ver+1))
$ git rebase ...

or like this:

$ git checkout $branch_to_rebase
$ git branch ${branch_to_rebase}-$(date +%Y-%m-%d)
$ git rebase ...

Either way I retain the old HEAD with some name.  This requires
discipline, so scripting it is useful.  But if you want discipline then
you want git to know that "for this branch, don't prune/gc old HEADs
orphaned after rebases" and "push the rebase history for this branch".

> > > https://git.csx.cam.ac.uk/x/ucs/git/git-repub.git
> >
> > Yeah, that's useful.
> 
> Glad you think so :-)

Thank you.

Nico
-- 

  reply	other threads:[~2014-08-07 17:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 18:31 "Branch objects" (was: Re: cherry picking and merge) Jakub Narębski
2014-08-06 20:07 ` Nico Williams
2014-08-07 11:38   ` Tony Finch
2014-08-07 15:58     ` Nico Williams
2014-08-07 16:42       ` Tony Finch
2014-08-07 17:22         ` Nico Williams [this message]
2014-08-07 17:47           ` Tony Finch
2014-08-07 22:54             ` Nico Williams
2014-08-07 22:59     ` Nico Williams

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=20140807172207.GP23449@localhost \
    --to=nico@cryptonector.com \
    --cc=dot@dotat.at \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=mikestump@comcast.net \
    /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).