Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Martin Langhoff <martin.langhoff@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Matthias Urlichs <smurf@smurf.noris.de>,
	Kalle Valo <Kalle.Valo@iki.fi>
Subject: Re: Pushing git patches to a subversion project
Date: Tue, 20 Dec 2005 23:25:19 -0800	[thread overview]
Message-ID: <7vpsnqdi8w.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <46a038f90512202137w772a3fe9p8e9e68345e39654a@mail.gmail.com> (Martin Langhoff's message of "Wed, 21 Dec 2005 18:37:26 +1300")

Martin Langhoff <martin.langhoff@gmail.com> writes:

> I am starting to work an svn-based upstream. In order to make life
> easy for me and for them I am trying to figure out a way for them to
> be able to merge my (emailed) patches atomically and preserving my
> comments.
>
> Something like git-am for svn.

Many building blocks git-am uses should be usable for this.

 * git-mailsplit you already know about due to earlier "non UNIX
   mbox" discussion.

 * git-mailinfo can be used to parse out commit message, title
   and authorship information, and actual patch.

 * git-apply without --index option can be used to apply patch
   to the working tree, but normal "patch -p1" would do the same
   unless it is a git renaming patch.  git-apply would also be
   useful for its --summary option to find out mode changes
   (if it is a git patch) and file creation and deletion.

So probably you could script something like this:

	$ git mailinfo .msg .patch <e-mail-file >.info
        $ (sed -ne 's/^Subject: //p' .info ; echo ; cat .msg) >.final-msg
	$ git apply --summary <.patch |
        while read cd mo de file
        do
        	case "$cd" in
                create)
                	svn add "$file" ;;
		delete)
                	svn rm "$file" ;;
		esac
	done
	$ svn commit -F .final-msg

      reply	other threads:[~2005-12-21  7:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-21  5:37 Pushing git patches to a subversion project Martin Langhoff
2005-12-21  7:25 ` Junio C Hamano [this message]

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=7vpsnqdi8w.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=Kalle.Valo@iki.fi \
    --cc=git@vger.kernel.org \
    --cc=martin.langhoff@gmail.com \
    --cc=smurf@smurf.noris.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