git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add optional parameters to the diff option "--ignore-submodules"
@ 2010-06-08 16:30 Jens Lehmann
  2010-06-08 16:31 ` [PATCH 1/2] git diff: rename test that had a conflicting name Jens Lehmann
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Jens Lehmann @ 2010-06-08 16:30 UTC (permalink / raw)
  To: Git Mailing List
  Cc: Junio C Hamano, Andy Parkins, Johannes Schindelin, Johan Herland

After thinking some time about peoples expectations and troubles
with the recursive scanning of submodules, I came up with this:

What about expanding the "--ignore-submodules" option of the git diff
family with three parameters:

--ignore-submodules=all : Same behavior as "--ignore-submodules",
  submodules show never up as modified.

--ignore-submodules=untracked : Don't consider submodules as modified
  when they only contain untracked files, but do if the commits in the
  superproject are different or tracked content is modified.

--ignore-submodules=dirty : Don't consider submodules as modified
  when their work tree is dirty, no matter why. This is the pre 1.7.0
  behavior and doesn't recurse into submodules at all.

The first patch is just a resend of a test case rename, the second
contains the implementation.


To make that more useful the default could be controlled by the
.git/config or .gitmodules file. So you could have two submodules:

[submodule "sub1"]
	path = sub1
	url = /home/me/sub1.git/
	ignore = dirty
[submodule "sub2"]
	path = sub2
	url = /home/me/sub2.git/
	ignore = untracked

Where sub1 will not be scanned for work tree modifications by "git
diff" and "git status" and for sub2 any untracked files inside the
submodule will be ignored. And then "git status" should learn the
"--ignore-submodule" option too. With a fourth parameter "none" it
would be possible to override the defaults from the configuration
anyway you want.

Opinions?


Jens Lehmann (2):
  git diff: rename test that had a conflicting name
  Add optional parameters to the diff option "--ignore-submodules"

 Documentation/diff-options.txt                     |   10 ++-
 diff-lib.c                                         |    1 +
 diff.c                                             |   11 +++-
 diff.h                                             |    1 +
 t/t4027-diff-submodule.sh                          |   20 ++++-
 ...submodule.sh => t4041-diff-submodule-option.sh} |   81 ++++++++++++++++++++
 6 files changed, 118 insertions(+), 6 deletions(-)
 rename t/{t4041-diff-submodule.sh => t4041-diff-submodule-option.sh} (74%)

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-06-24 17:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-08 16:30 [PATCH 0/2] Add optional parameters to the diff option "--ignore-submodules" Jens Lehmann
2010-06-08 16:31 ` [PATCH 1/2] git diff: rename test that had a conflicting name Jens Lehmann
2010-06-08 16:31 ` [PATCH 2/2] Add optional parameters to the diff option "--ignore-submodules" Jens Lehmann
2010-06-24 14:23   ` Brandon Casey
2010-06-24 17:11     ` Jens Lehmann
2010-06-08 17:28 ` [PATCH 0/2] " Junio C Hamano
2010-06-08 20:41   ` Jens Lehmann
2010-06-08 21:02     ` Johannes Schindelin
2010-06-08 23:26       ` Junio C Hamano
2010-06-08 23:36         ` Johannes Schindelin
2010-06-08 22:11 ` Johan Herland
2010-06-08 22:19   ` Jens Lehmann
2010-06-08 23:49     ` Johan Herland
2010-06-09  6:23       ` Jens Lehmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).