Question

I'm looking for git cherry to behave more like git log.

I have two independent branches in my git repository (result of svn import). No common ancestor, no merges between them. I don't want these two branches to be ever connected, even though they concern the same project.

The two branches are:

master (clean line, releasable code)

old_trunk (junk development branch, with experimental commits as well as ones that I want to cherry pick)

Now,

$ git cherry old_trunk -v

properly identifies changesets that were already applied to the master (as svn merge is working more like a cherry pick).

However git log:

$ git log --cherry --cherry-mark master..old_trunk

shows all commits as not yet applied to master. It's either broken or using different mechanism to find cherry picks.

I'm looking for a solution to navigate through old_trunk history to see the author, see the date of the commit, see full commit message, and most importantly to be able to distinguish cherry-picks already done.

Any thoughts?

Was it helpful?

Solution

Well, you can list all the commits with git cherry and then run them through a loop to show each one returned. Would something like this work for you?

for i in $(git cherry old_trunk | cut -d" " -f 2); do git show $i --quiet --pretty=fuller; done
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top