* Pushing git patches to a subversion project
@ 2005-12-21 5:37 Martin Langhoff
2005-12-21 7:25 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Martin Langhoff @ 2005-12-21 5:37 UTC (permalink / raw)
To: Git Mailing List, Matthias Urlichs, Kalle Valo
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.
Ideally, it should keep the patch as free of corruption as possible,
as the results will be echoed back into my branches via git-svnimport
and later "cg-update upstream" and I want git-cherry to have a fair go
at matching them.
There doesn't seem to be much. SVN-based projects ask for unified
diffs mostly, and I can't find indication of patch trading that
includes commit messages.
Any hints?
cheers,
martin
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Pushing git patches to a subversion project
2005-12-21 5:37 Pushing git patches to a subversion project Martin Langhoff
@ 2005-12-21 7:25 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2005-12-21 7:25 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Git Mailing List, Matthias Urlichs, Kalle Valo
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-12-21 7:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-21 5:37 Pushing git patches to a subversion project Martin Langhoff
2005-12-21 7:25 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox