From: "Jean-Baptiste Quenot" <jbq@caraldi.com>
To: git@vger.kernel.org
Subject: Re: Recording cherry-picked commits
Date: Sat, 22 Mar 2008 17:37:33 +0100 [thread overview]
Message-ID: <ae63f8b50803220937k78571fbdl1eeb60966ec7aa40@mail.gmail.com> (raw)
In-Reply-To: <ae63f8b50803210533n12645fb3w9a8be601c4cc394@mail.gmail.com>
What about using a hidden ".gitcherry" file in the current branch to
store the commits that have been applied? With the simple shell
scripts below I'm able to achieve the same effect as svnmerge:
Wrapper around git-cherry-pick:
------------------------------------------------------------------------
#! /bin/sh -e
# Write the commit in .gitcherry, stage .gitcherry for commit and call
# git-cherry-pick. If a conflict occurs, resolve it and invoke this script with
# --continue, in order to commit with the original author and commit message
if test "$1" = "--continue" ; then
cont=1
commit=$(tail -1 .gitcherry)
else
cont=0
commit=$1
fi
if test $cont = 0 ; then
echo $commit >> .gitcherry
git add .gitcherry
git cherry-pick $commit
else
git commit -c $commit
fi
-------------------------------------------------------------------------
Wrapper around git-cherry:
------------------------------------------------------------------------
#! /bin/sh -e
# List all commits with git-cherry and exclude all the ones that are specified
# in .gitcherry. For each commit, invoke 'git show' to print the commit message
for commit in $(git-cherry $* | sed -ne 's/^+ //p' | grep -v -f .gitcherry) ; do
git show -s --pretty=format:"%H %s" $commit
done
------------------------------------------------------------------------
WDYT?
--
Jean-Baptiste Quenot
http://caraldi.com/jbq/blog/
next prev parent reply other threads:[~2008-03-22 16:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-21 12:33 Recording cherry-picked commits Jean-Baptiste Quenot
2008-03-22 16:37 ` Jean-Baptiste Quenot [this message]
2008-03-22 22:48 ` Rafael Garcia-Suarez
2008-03-23 0:37 ` Junio C Hamano
2008-03-23 11:07 ` Jean-Baptiste Quenot
2008-03-23 12:11 ` Johannes Schindelin
2008-03-23 13:57 ` Rafael Garcia-Suarez
2008-03-23 14:12 ` Johannes Schindelin
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=ae63f8b50803220937k78571fbdl1eeb60966ec7aa40@mail.gmail.com \
--to=jbq@caraldi.com \
--cc=git@vger.kernel.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).