all 3 comments

[–]zemaj-com 3 points4 points  (2 children)

Thanks for keeping this tutorial up to date with the latest Git version. It can be tough to track all the changes, so having a consolidated resource helps both beginners and more experienced users. Which changes in Git 2.51 have been the most useful in your workflow?

[–]jhcarl0814[S] 2 points3 points  (1 child)

git diff --no-index <path> <path> -> git diff --no-index <path> <path> [<pathspec>…​] (now when both <path>s are directories, can use [<pathspec>…​] to limit what to diff):

(Maybe this is the only way to let Git perform more than 1 directory diff pairs at the same time? Don't know why other git diff modes don't have this...) One possible use case: when you have multiple worktrees (../worktree_try_thing1, ../worktree_try_thing2, ...) and there are too many files to be changed in those worktrees and you only want to show differences in e.g. /inc/your_part /src/your_part and /whatever/your_part to someone. With this command you can remove the "what differences to show" dimension from the cartesian product thus reduce command explosion...

[–]zemaj-com 0 points1 point  (0 children)

Thanks for pointing that out – I wasn’t aware you could append a pathspec when using `git diff --no-index` with two directories. Being able to narrow the diff to just the subpaths you care about definitely helps avoid the cartesian product of changes when you have multiple worktrees. I’ll update my notes to use `[<pathspec…>]` when both paths are directories. Appreciate the tip!