Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH V2] check-ignore: Add option to ignore index contents

From: Eric Sunshine <hidden>
Date: 2016-06-15 22:58:36

On Mon, Sep 2, 2013 at 5:20 PM, Dave Williams
[off-list ref] wrote:
I have updated the original version of this patch to encompass the
feedback comments obtained. Updates include:
1) Rename option to --no-index for consistency with other commands
2) Improved Documentation text
3) Extension to test scripts to include this option

Regarding test scripts I have scoped coverage to ensure correct
behaviour with the new option in all standard cases but without
duplicating every single corner case.

The original patch is at $gmane/233381.
This commentary, which is not intended as part of the commit message,
normally goes below the '---' line after your sign-off just before the
diffstat. When the project maintainer applies a patch with git-am,
such commentary is stripped out automatically, otherwise he has to
strip it manually. (Alternately, you could use a -->8-- line to
separate the above commentary from the commit message.)

One more minor issue below...
quoted hunk ↗ jump to hunk
check-ignore currently shows how .gitignore rules would treat untracked
paths. Tracked paths do not generate useful output.  This prevents
debugging of why a path became tracked unexpectedly unless that path is
first removed from the index with `git rm --cached <path>`.

This option (-i, --no-index) simply by-passes the check for the path
being in the index and hence allows tracked paths to be checked too.

Whilst this behaviour deviates from the characteristics of `git add` and
`git status` its use case is unlikely to cause any user confusion.

Test scripts are augmented to check this option against the standard
ignores to ensure correct behaviour.

Signed-off-by: Dave Williams <redacted>
---
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index c29342d..0ad0534 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -87,6 +87,9 @@ test_check_ignore () {
 # check-ignore --verbose output is the same as normal output except
 # for the extra first column.
 #
+# A parameter is used to determine if the tests are run with the
+# normal case (using the index), or with the -i or --no_index option.
s/--no_index/--no-index/
+#
 # Arguments:
 #   - (optional) prereqs for this test, e.g. 'SYMLINKS'
 #   - test name
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help