git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Martin Waitz <tali@admingilde.org>
Cc: git@vger.kernel.org
Subject: Re: [RFC] git commit --branch
Date: Mon, 29 May 2006 16:41:58 -0400	[thread overview]
Message-ID: <20060529204158.GC28538@spearce.org> (raw)
In-Reply-To: <20060529202851.GE14325@admingilde.org>

Martin Waitz <tali@admingilde.org> wrote:
> Allow to commit to another branch and creating a merge in the current branch.

Interesting.  I have been kicking around doing the very same
thing myself but just have not gotten around to it.  Its complex,
especially if the current HEAD isn't strictly the merge commit
between the topic branch and the previous value of HEAD; in that
case you may want to replay the commits which are on HEAD but are
post the merge commit using a form of git-rebase.  Except you would
want to preserve any merges which happened by remerging them rather
than simply exporting a massive patch and reapplying it.
 
> +		test $(git merge-base "$onto_branch" HEAD^) != $onto_branch_commit &&
> +		test $(git merge-base "$onto_branch"^ HEAD^) = $(git rev-parse --verify "$onto_branch"^) ||
> +			die "commits on $onto_branch and HEAD differ, cannot amend."
> +		onto_branch_commit=$(git rev-parse --verify "$onto_branch"^)

Shouldn't these be 'git-merge-base' and 'git-rev-parse' ?

> +		git update-ref "$onto_branch" $commit2 &&

If this is going into next perhaps you would like to considering adding
the -m flag to your git-update-ref calls and include a log message
in the reflog (if the user has it enabled for the current branch and
the topic branch)?

Also shouldn't this be 'git-update-ref'?

-- 
Shawn.

  reply	other threads:[~2006-05-29 20:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-29 20:28 [RFC] git commit --branch Martin Waitz
2006-05-29 20:41 ` Shawn Pearce [this message]
2006-05-29 21:22   ` Martin Waitz
2006-05-29 21:35     ` Shawn Pearce
2006-05-29 21:55       ` Martin Waitz
2006-05-29 22:16         ` Shawn Pearce
2006-05-29 21:14 ` Johannes Schindelin
2006-05-29 21:27   ` Jakub Narebski
2006-05-29 21:37   ` Martin Waitz
2006-05-29 21:58     ` Johannes Schindelin
2006-05-30  9:12 ` Junio C Hamano
2006-05-30 21:05   ` Martin Waitz
2006-05-30 22:52     ` Junio C Hamano
2006-05-31 15:21       ` Martin Waitz
2006-06-05 18:22       ` Jon Loeliger

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=20060529204158.GC28538@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=tali@admingilde.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).