Can Git work with SVN svn mergeinfo - show-revs

I use SVN and have a stable production branch and an unstable trunk. For each release, we cherry pick items from the trunk that should be combined with production.

I cloned my SVN repo using git svn to use a faster search for commits that I need to combine (since I am looking for the JIRA identifier in the commit message). However, I am still doing my merge with svn merge at the end of this.

One of the problems with this long manufacturing industry is that in chests that do not merge can potentially be left behind.

To do this, I sometimes run:

svn mergeinfo --show-revs eligible https://my.server/svn/trunk https://my.server/svn/branches/PROD_V3.00

However, it is very slow. The equivalent in git is

git log prod..master

However, this seems to be just a list of all commits.

Is this because git doesn't recognize svn merges and the svn: mergeinfo property?

Is there any way I can quickly get valid commits using git?

EDIT:

I tried to answer Jos, however it git cherryjust outputs SHA and I need a version of SVN to merge. So I had to run it through git svn find-revto find the SVNs to get what I needed.

git cherry prod master|cut -d' ' -f2|while read -r line; do git svn find-rev "$line"; done;

Unfortunately, this is slower than svn mergeinfo --show-revs eligible.

+5
source share
2 answers

If the commits were chosen cherry, you now have two copies of these commits. Git will show you all the commits in master, even if they have a copy in prod.

Perhaps equivalent:

git cherry master prod

- master, , , prod.

+3

Perl, git -svn - perl script, git svn find-rev - perl script. , rev_map .

, , :

git cherry prod master|cut -d' ' -f2|while read -r line; do git svn find-rev "$line"; done

- ( b/c git -svn repo):

#!/usr/bin/perl

use Carp;
use Git::SVN;
# use ...the rest of the Git::SVN module...

# ...initialize whatever is necessary...

open(ELIGIBLE_COMMITS, "git cherry prod master") || croak "Couldn't do git cherry";
while (<ELIGIBLE_COMMITS>) {
    ($ignore, $sha1) = split;
    my (undef, $rev, undef) = cmt_metadata($sha1);
    print "$rev\n";
}
close(ELIGIBLE_COMMITS);

git-svn script cmd_find_rev, , , ,

find-rev --file <filename>

"-" STDIN.

+1

All Articles