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

Add pathspec support in git-missing #1156

Merged
merged 4 commits into from
Aug 26, 2024

Conversation

Weyzu
Copy link
Contributor

@Weyzu Weyzu commented Aug 20, 2024

This PR add pathspec support for the git-missing command. Users can now limit the commit difference to specific directories or files. Addition is particularly useful for big repositories where users are not concerned with other directories outside their usual workspace.

Pathspec is optional, command will work as usual for users not using it.

New Usage

git missing [<first branch>] <second branch> [<git log options>] [[--] <path>...]

Example

Compare differences between the current branch and master, limited to the src/ directory:

$ git missing master -- src/
< a1b2c3d feat: Add new component in src/
> d4e5f6g fix: Update existing module in src/

Allow to specify a path to limit the commit difference list. This
improvement allows users to focus on changes in specific directories or
files when comparing branches for missing commits.
Copy link
Collaborator

@hyperupcall hyperupcall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix! I did see a bug - that passing multiple files to be used as a pathspec is not supported. My comments have more details

bin/git-missing Outdated Show resolved Hide resolved
bin/git-missing Show resolved Hide resolved
bin/git-missing Outdated Show resolved Hide resolved
- Change pathspec from string to array to support multiple pathspecs
- Remove unnecessary 'shift' command in argument processing loop
- Simplify git log command execution by using a single codepath
@Weyzu
Copy link
Contributor Author

Weyzu commented Aug 22, 2024

@hyperupcall Sorry for slight delay in response. Thank you for the ultra fast review and quality feedback. 👍🏻

@hyperupcall
Copy link
Collaborator

@Weyzu Thanks! Everything looks great to me! @spacewander what do you think?

Copy link
Collaborator

@spacewander spacewander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you update the md https://github.com/tj/git-extras/blob/main/man/git-missing.md and generate new doc from it?
Thanks!

@Weyzu
Copy link
Contributor Author

Weyzu commented Aug 23, 2024

@spacewander Sure thing, updated. :) (8716c18 + d3c1b3a) Let me know if I phrased it all correctly.

@spacewander spacewander merged commit f0b9e18 into tj:main Aug 26, 2024
5 checks passed
@spacewander
Copy link
Collaborator

Merged. Thanks!

@Weyzu Weyzu deleted the feat/add-pathspec-to-git-missing branch August 26, 2024 07:13
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.

3 participants