diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2007-04-15 11:14:28 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-15 12:52:48 -0700 |
commit | 04786756f90a734445cc300a5acf9fcfc9fd4c04 (patch) | |
tree | 769dae445798867c6afb2e924c181dce8ed08ec0 /refs.c | |
parent | 5698454ea052369dc98d38b45c21307b07a6c4a3 (diff) | |
download | git-04786756f90a734445cc300a5acf9fcfc9fd4c04.tar.gz git-04786756f90a734445cc300a5acf9fcfc9fd4c04.tar.xz |
Expose subprojects as special files to "git diff" machinery
The same way we generate diffs on symlinks as the the diff of text of the
symlink, we can generate subproject diffs (when not recursing into them!)
as the diff of the text that describes the subproject.
Of course, since what descibes a subproject is just the SHA1, that's what
we'll use. Add some pretty-printing to make it a bit more obvious what is
going on, and we're done.
So with this, we can get both raw diffs and "textual" diffs of subproject
changes:
- git diff --raw:
:160000 160000 2de597b5ad348b7db04bd10cdd38cd81cbc93ab5 0000000... M sub-A
- git diff:
diff --git a/sub-A b/sub-A
index 2de597b..e8f11a4 160000
--- a/sub-A
+++ b/sub-A
@@ -1 +1 @@
-Subproject commit 2de597b5ad348b7db04bd10cdd38cd81cbc93ab5
+Subproject commit e8f11a45c5c6b9e2fec6d136d3fb5aff75393d42
NOTE! We'll also want to have the ability to recurse into the subproject
and actually diff it recursively, but that will involve a new command line
option (I'd suggest "--subproject" and "-S", but the latter is in use by
pickaxe), and some very different code.
But regardless of ay future recursive behaviour, we need the non-recursive
version too (and it should be the default, at least in the absense of
config options, so that large superprojects don't default to something
extremely expensive).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'refs.c')
0 files changed, 0 insertions, 0 deletions