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

git meta diff should not read off of the index for diffs #712

Open
dvamin opened this issue Jun 21, 2019 · 2 comments
Open

git meta diff should not read off of the index for diffs #712

dvamin opened this issue Jun 21, 2019 · 2 comments
Labels

Comments

@dvamin
Copy link
Collaborator

dvamin commented Jun 21, 2019

git meta diff shows you changes from both disk and the index. This is inconsistent with git diff which shows only the unstaged changes. You need git diff --cached to see the staged changes, and git diff HEAD for both. Please make git meta diff usage consistent with git diff.

@rgeary19
Copy link

rgeary19 commented Jul 1, 2019

+1

@lordmauve
Copy link
Member

It seems that git-meta diff is not implemented by git-meta; it just expands to

git diff --submodule=diff

which shows a diff in each submodule. Adding --staged then expands to

git diff --submodule=diff --staged

which is equivalent to showing the staged meta-repo changes, i.e. staged submodule commits.

I was able to get a better diff using this script:

#!/bin/bash
PAGER=cat git submodule foreach --quiet "git diff --src-prefix a/\$sm_path/ --dst-prefix b/\$sm_path/ --color=always $@" | less -FXR

This works with --staged and without, I haven't tried any other options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants