twosigma / twosigma/git-meta

FR: Smart path-based `git meta log` that peeks inside submodules

Open
#643 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
233
Forks
54
PR merge metrics
No merged PRs in 30d

Description

If I have submodules `a/z`, `a/y`, `b/w`, and `c/`, and I want to see a history of changes that touched certain files inside them, it would be cool if I could run `git meta log -- a/z/foo/bar a/y/baz b/ c/`. Git-meta would then inspect each path:
- if it's a submodule, include all commits which touched that submodule.
- if it's a meta repo path, inlcude all commits which touched submodules under that path.
- if it has a strict prefix which matches a submodule, then:
- "half-initialize" the submodule in .git/modules if it isn't already there. (No need to checkout a tree.)
- for each meta commit which touches the submodule,
- fetch the starting and ending commits in the submodule and diff their trees*
- if the diff touches any file matching the path suffix, include it in the log.

(* Note that this would not include any meta commit introducing a series of submodule commits which touched and then reverted the file. For our own case, I think that's correct. One alternative might be, "if the ending commit is a descendant of the starting commit, iterate along the path from start to end, and if any submodule commits touch the given path suffix, include the meta commit in the log.". But sometimes the ending commit will not be a descendant, and then what?)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.