-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Provide log functionality wrapping the revwalk #3041
Comments
Just a note that if you activate path-based history simplification, you can't use the revwalk to guide you since you need to be able to skip sub-histories without hiding, which the revwalk can't let you do. |
What is the current thinking here? I assume we would add something to /**
* Push a single filepath into the revwalk
*
* Enqueues commits relating to the history of the file.
* Often combined with `git_revwalk_simplify_first_parent`
*
* @param walk the walker being used for the traversal
* @param path the relative path of the file to be walked
* @return 0 or an error code
*
*/
GIT_EXTERN(int) git_revwalk_push_path(git_revwalk *walk, const char *path); This would then allow the walker to do efficient detection of whether a commit is relevant because it affected the file, as mentioned here. Need some of the |
The revwalk code provides a way to specify a range of commits to work with but little else (it does do first-parent walks as that was relatively easy to put into the code).
Users want to perform more complex operations, similarly to how git-log provides features on top of git-rev-list. We want to provide them, but we also don't want the revwalk code to become unwieldy. Thus some code which leverages the revwalk to provide the range of commits but does simplification or filtering on top sounds like a good way to do both of these.
Some of the feature this
git_log
(or similar) namespace/object would provide would be:--cherry-pick
A combination of limiting the number of returned commits and filtering by path would allow a caller to ask for the last commit (in whatever sorting) to touch a particular path.
I will be closing some of the issues which deal with specific aspects of this and redirect them here.
The text was updated successfully, but these errors were encountered: