Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 579402 - sys-apps/portage: egencache --update-changelogs could be better optimized for merge commits
Summary: sys-apps/portage: egencache --update-changelogs could be better optimized for...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-04-09 07:49 UTC by Zac Medico
Modified: 2022-10-20 02:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2016-04-09 07:49:31 UTC
Currently, egencache --update-changelogs uses this command:

git diff-tree --name-status --no-renames '--format=%ct %cN <%cE>%n%B' --root --relative=${CATEGORY}/${PN} -m -r ${COMMIT_HASH} -- .

It has been pointed out by Doug Freed that `git log -m --first-parent` will be more optimal for rendering merge commits. This option combination is described as follows in the git log man page:

 This flag makes the merge commits show the full diff like regular commits; for each merge parent, a separate log entry and diff is generated. An exception is that only diff against the first parent is shown when --first-parent option is given; in that case, the output represents the changes the merge brought into the then-current branch.

The following git log command appears to serve as a suitable replacement for the existing git diff-tree command:

git log --name-status --no-renames '--format=%ct %cN <%cE>%n%B' --root --relative=${CATEGORY}/${PN} -n1 -m --first-parent -r ${COMMIT_HASH} -- .
Comment 1 Zac Medico gentoo-dev 2016-04-09 08:05:16 UTC
(In reply to Zac Medico from comment #0)
> git log --name-status --no-renames '--format=%ct %cN <%cE>%n%B' --root
> --relative=${CATEGORY}/${PN} -n1 -m --first-parent -r ${COMMIT_HASH} -- .

Seems that git diff-tree also accepts the -m --first-parent options.

I guess it's preferable to use git-diff-tree, since it's not in the "main porcelain commands" section of the git man page.
Comment 2 Zac Medico gentoo-dev 2016-04-09 09:12:27 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_579402

I've posted it for review here:

https://archives.gentoo.org/gentoo-portage-dev/message/2e70000ce0f3c4730385cb5d7d7469f9
Comment 3 Zac Medico gentoo-dev 2016-05-18 16:25:37 UTC
@dwfree: Patch looks good? Brian wanted to make sure you review it before we merge it.