git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Difficulty with getting an accurate changelog after cherry-picking and merging.

From
LPLuuk Paulussen <luuk.paulussen@gmail.com>
Date
Jul 22, 2008, 20:38 UTC
Message-ID
<7dc909980807221338g707d6104ob8b1534cdf02a77a@mail.gmail.com>
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

Next: Alex Riesen
Message 1 of 3 in “Difficulty with getting an accurate changelog after cherry-picking and merging.”
  1. Luuk PaulussenJul 22, 2008
  2. Alex RiesenJul 22, 2008
  3. Johannes SchindelinJul 22, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.