Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SVN log history woes



On 04/15/2011 08:46 AM, theBlueSage wrote:
> However, if I then merge foo.txt back into trunk and do svn log foo.txt
> I will only see 3 commits. the two I did before the branching, and the
> commit message from the merge back into trunk. I need to find a way to
> see all the history.

Interesting problem.  What version of svn are you using?  1.6+ keeps
much better information about merges, and there is a flag to "svn log"
now that shows additional info from the merge history (-g /
--use-merge-history).  I don't have a 1.6 repo with properly done merges
handy, so I can't tell you exactly what that adds.

If that doesn't do what you want, you could do a few things:
- If you formatted your merge messages in a particular way (to include
the path to the branch that is being merged, etc), then it should
theoretically be possible to wrap the svn log in a script that
recursively calls svn log on the merged branches (using --stop-on-copy).

- You could write a script (or if you want to get fancy, do it as a
pre-commit hook, which is allowed to modify the log) to generate a
commit message for the /merge commit/ that includes all the constituent
commit messages from the branch.

I think doing the second option is probably better, and done in a
non-automatic way (ie don't do the pre-commit hook).  The reason is the
same as the reason why subversion doesn't do this automatically:  the
nature of a merge /may/ include human intervention and/or more manual
changes.  These manual changes may invalidate/undo some of the changes
from the branch.

So unless you have a policy where merges may only contain results of
"svn merge" and no manual edits (which in turn would require the branch
maintainer to keep making commits to the branch until it would merge
cleanly), then it's not safe to do anything automatic.

HTH,
Matt





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org