Skip to content

Add pathspec support in git-missing#1156

Merged
spacewander merged 4 commits intotj:mainfrom
Weyzu:feat/add-pathspec-to-git-missing
Aug 26, 2024
Merged

Add pathspec support in git-missing#1156
spacewander merged 4 commits intotj:mainfrom
Weyzu:feat/add-pathspec-to-git-missing

Conversation

@Weyzu
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread bin/git-missing Outdated
Comment thread bin/git-missing
Comment thread bin/git-missing Outdated
- 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
Copy Markdown
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
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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.

@Weyzu
Copy link
Copy Markdown
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
@spacewander
Copy link
Copy Markdown
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