From c7e1a73641e24340bf93f6f1792220fa9154cda3 Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Thu, 4 Mar 2010 22:20:33 +0100 Subject: git diff --submodule: Show detailed dirty status of submodules When encountering a dirty submodule while doing "git diff --submodule" print an extra line for new untracked content and another for modified but already tracked content. And if the HEAD of the submodule is equal to the ref diffed against in the superproject, drop the output which would just show the same SHA1s and no commit message headlines. To achieve that, the dirty_submodule bitfield is expanded to two bits. The output of "git status" inside the submodule is parsed to set the according bits. Signed-off-by: Jens Lehmann Signed-off-by: Junio C Hamano --- diffcore.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'diffcore.h') diff --git a/diffcore.h b/diffcore.h index 66687c3fe..fcd00bf27 100644 --- a/diffcore.h +++ b/diffcore.h @@ -42,7 +42,9 @@ struct diff_filespec { #define DIFF_FILE_VALID(spec) (((spec)->mode) != 0) unsigned should_free : 1; /* data should be free()'ed */ unsigned should_munmap : 1; /* data should be munmap()'ed */ - unsigned dirty_submodule : 1; /* For submodules: its work tree is dirty */ + unsigned dirty_submodule : 2; /* For submodules: its work tree is dirty */ +#define DIRTY_SUBMODULE_UNTRACKED 1 +#define DIRTY_SUBMODULE_MODIFIED 2 struct userdiff_driver *driver; /* data should be considered "binary"; -1 means "don't know yet" */ -- cgit v1.2.1