Re: Pushing git patches to a subversion project

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Martin Langhoff <martin.langhoff@...>
Cc: Git Mailing List <git@...>, Matthias Urlichs <smurf@...>, Kalle Valo <Kalle.Valo@...>
Date: Wednesday, December 21, 2005 - 3:25 am

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


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


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Pushing git patches to a subversion project, Martin Langhoff, (Wed Dec 21, 1:37 am)
Re: Pushing git patches to a subversion project, Junio C Hamano, (Wed Dec 21, 3:25 am)