Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let --find-objects find top-level trees by their OID, too #1615

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dscho
Copy link
Member

@dscho dscho commented Nov 20, 2023

TODO: add test, document that -c and --cc are buggy and show commit headers even though the pickaxe machinery does not select the commit.

TODO: add test, document that `-c` and `--cc` are buggy and show commit
headers even though the pickaxe machinery does not select the commit.

Due to technical reasons, the diff machinery does not print out the root
tree of any given commit when running with the `-t` option (for details,
see https://git-scm.com/docs/git-log#Documentation/git-log.txt--t).

However, quite often that is precisely what I need to find: the commit
that introduced a certain change that ended up with the exact
problematic (recursive) tree shape.

The underlying problem is that the layer at which `-t` prints entries is
when iterating the tree items, but the root tree is not a child of
another tree, therefore it is never reached through such an iteration.

So let's fudge things by specifically adding the root tree OID into the
`objfind` set for commits that change the top-level tree.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant