Git development
 help / color / mirror / Atom feed
* Difficulty with getting an accurate changelog after cherry-picking and merging.
@ 2008-07-22 20:38 Luuk Paulussen
  2008-07-22 21:09 ` Alex Riesen
  2008-07-22 21:14 ` Johannes Schindelin
  0 siblings, 2 replies; 3+ messages in thread
From: Luuk Paulussen @ 2008-07-22 20:38 UTC (permalink / raw)
  To: git

Hi,

I'm trying to generate an accurate changelog of changes between 2 tags
on a branch.  There is a merge between these 2 points which includes
changes that were cherry-picked before the start point.  This causes
the changelog to show these changes, despite them already existing
before the start point of the log.

I've included a test script below that creates a repository that shows
a simplified version of the issue.  Basically, I want the changelog to
only show the changes between the start and end tags, which are test4
and test5, but I get a list that also includes other commits.  I have
tried git-cherry and git-log with --cherry-pick and various things
with git-rev-list and git-merge-base.

#!/bin/sh
mkdir testrepo
cd testrepo
git init
echo initial > testfile
git add testfile
git commit -m initial
git branch stable
for f in $(seq 1 5)
do
    echo test$f >> testfile
    git commit -a -m test$f
done
#without this sleep the cherry-picks end up with the same hash as
their original commit...
sleep 1
git checkout stable
git cherry-pick :/test1
git cherry-pick :/test2
git cherry-pick :/test3
git tag start
git cherry-pick :/test4
git merge master
#Clean up the merge error.
if [ ! $? -eq 0 ]
then
    sed -i "/[:=]/ d" testfile
    git commit -a -m "Merge branch 'master' into stable"
fi
git tag end
##########################

Thanks,
Luuk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Difficulty with getting an accurate changelog after cherry-picking and merging.
  2008-07-22 20:38 Difficulty with getting an accurate changelog after cherry-picking and merging Luuk Paulussen
@ 2008-07-22 21:09 ` Alex Riesen
  2008-07-22 21:14 ` Johannes Schindelin
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Riesen @ 2008-07-22 21:09 UTC (permalink / raw)
  To: luuk; +Cc: git

Luuk Paulussen, Tue, Jul 22, 2008 22:38:19 +0200:
> I'm trying to generate an accurate changelog of changes between 2 tags
> on a branch.  There is a merge between these 2 points which includes
> changes that were cherry-picked before the start point.  This causes
> the changelog to show these changes, despite them already existing
> before the start point of the log.

Cherry-picked commits are completely new commits and have no relation
to the original commits whatsoever. Of course, they will be shown.
It is literally a change made again, as if you typed it all in and
committed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Difficulty with getting an accurate changelog after cherry-picking and merging.
  2008-07-22 20:38 Difficulty with getting an accurate changelog after cherry-picking and merging Luuk Paulussen
  2008-07-22 21:09 ` Alex Riesen
@ 2008-07-22 21:14 ` Johannes Schindelin
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2008-07-22 21:14 UTC (permalink / raw)
  To: Luuk Paulussen; +Cc: git

Hi,

On Wed, 23 Jul 2008, Luuk Paulussen wrote:

> I'm trying to generate an accurate changelog of changes between 2 tags 
> on a branch.  There is a merge between these 2 points which includes 
> changes that were cherry-picked before the start point.  This causes the 
> changelog to show these changes, despite them already existing before 
> the start point of the log.
>
> [...]
> 
> I have tried git-cherry and git-log with --cherry-pick and various 
> things with git-rev-list and git-merge-base.

cherry and --cherry-pick will only skip patches that are on the 
uninteresting side of a "..." range.

I guess that

	$ git log --cherry-pick master...HEAD^

should filter the commits out, but I haven't tried.

> git cherry-pick :/test1

Heh, that is the first time I see :/ in the wild.  I do not use it 
anymore, and in your case, I would have written "git cherry-pick master^4" 
to be more precise (and not accidentally pick up a wrong one).

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-22 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-22 20:38 Difficulty with getting an accurate changelog after cherry-picking and merging Luuk Paulussen
2008-07-22 21:09 ` Alex Riesen
2008-07-22 21:14 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox