summaryrefslogtreecommitdiff
path: root/t/t4041-diff-submodule-option.sh
AgeCommit message (Collapse)AuthorFilesLines
2012-12-02t4041 (diff-submodule-option): modernize styleLibravatar Ramkumar Ramachandra1-230/+229
- Enclose tests in single quotes as opposed to double quotes. This is the prevalent style in other tests. - Remove the unused variable $head4_full. - Indent the expected output so that it lines up with the rest of the test text. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-02t4041 (diff-submodule-option): rewrite add_file() routineLibravatar Ramkumar Ramachandra1-12/+12
Instead of "cd there and then come back", use the "cd there in a subshell" pattern. Also fix '&&' chaining in one place. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-02t4041 (diff-submodule-option): parse digests sensiblyLibravatar Ramkumar Ramachandra1-7/+7
`git rev-list --max-count=1 HEAD` is a roundabout way of saying `git rev-parse --verify HEAD`; replace a bunch of instances of the former with the latter. Also, don't unnecessarily `cut -c1-7` the rev-parse output when the `--short` option is available. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-27t4041 (diff-submodule-option): don't hardcode SHA-1 in expected outputsLibravatar Ramkumar Ramachandra1-5/+5
The expected SHA-1 digests are always available in variables. Use them instead of hardcoding. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-18diff: rename "set" variableLibravatar Jeff King1-0/+15
Once upon a time the builtin_diff function used one color, and the color variables were called "set" and "reset". Nowadays it is a much longer function and we use several colors (e.g., "add", "del"). Rename "set" to "meta" to show that it is the color for showing diff meta-info (it still does not indicate that it is a "color", but at least it matches the scheme of the other color variables). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-18diff: introduce diff.submodule configuration variableLibravatar Ramkumar Ramachandra1-1/+28
Introduce a diff.submodule configuration variable corresponding to the '--submodule' command-line option of 'git diff'. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-14teach add_submodule_odb() to look for alternatesLibravatar Heiko Voigt1-0/+34
Since we allow to link other object databases when loading a submodules database we should also load possible alternates. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-14tests: use test_cmp instead of piping to diff(1)Libravatar Ævar Arnfjörð Bjarmason1-32/+64
Change submodule tests that piped to diff(1) to use test_cmp. The resulting unified diff is easier to read. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09tests: subshell indentation stylefixLibravatar Jonathan Nieder1-3/+4
Format the subshells introduced by the previous patch (Several tests: cd inside subshell instead of around, 2010-09-06) like so: ( cd subdir && ... ) && This is generally easier to read and has the nice side-effect that this patch will show what commands are used in the subshell, making it easier to check for lost environment variables and similar behavior changes. Cc: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-06Several tests: cd inside subshell instead of aroundLibravatar Jens Lehmann1-3/+3
Fixed all places where it was a straightforward change from cd'ing into a directory and back via "cd .." to a cd inside a subshell. Found these places with "git grep -w "cd \.\.". Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-25t4027,4041: Use test -s to test for an empty fileLibravatar Brian Gernhardt1-7/+7
The tests used a mixture of 'echo -n' (which is non-portable) and either test_cmp or diff to check if a file is empty. The much easier and portable method to check for an empty file is '! test -s' While we're in t4027, there was an excess test_done. Remove it. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11Add optional parameters to the diff option "--ignore-submodules"Libravatar Jens Lehmann1-0/+81
In some use cases it is not desirable that the diff family considers submodules that only contain untracked content as dirty. This may happen e.g. when the submodule is not under the developers control and not all build generated files have been added to .gitignore by the upstream developers. Using the "untracked" parameter for the "--ignore-submodules" option disables checking for untracked content and lets git diff report them as changed only when they have new commits or modified content. Sometimes it is not wanted to have submodules show up as changed when they just contain changes to their work tree. An example for that are scripts which just want to check for submodule commits while ignoring any changes to the work tree. Also users having large submodules known not to change might want to use this option, as the - sometimes substantial - time it takes to scan the submodule work tree(s) is saved. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11git diff: rename test that had a conflicting nameLibravatar Jens Lehmann1-0/+347
In 86140d5 the new test t4041-diff-submodule.sh was introduced although t4027-diff-submodule.sh already existed. Rename the newer test to t4041-diff-submodule-option.sh to fix that. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>