From ae3cdfe1123d153f720bbe4a4abc97ed3e9f65a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 8 Nov 2010 01:04:58 +0700 Subject: [PATCH 1/2] dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit c84de70 (excluded_1(): support exclude files in index - 2009-08-20) tries to work around the fact that there is no directory/file information in index entries, therefore EXC_FLAG_MUSTBEDIR match would fail. Unfortunately the workaround is flawed. This fixes it. Reported-by: Thomas Rinderknecht Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- dir.c | 3 ++- t/t1011-read-tree-sparse-checkout.sh | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dir.c b/dir.c index d1e5e5e5b..b2dfb69eb 100644 --- a/dir.c +++ b/dir.c @@ -360,7 +360,8 @@ int excluded_from_list(const char *pathname, if (x->flags & EXC_FLAG_MUSTBEDIR) { if (!dtype) { - if (!prefixcmp(pathname, exclude)) + if (!prefixcmp(pathname, exclude) && + pathname[x->patternlen] == '/') return to_exclude; else continue; diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh index 9a07de1a5..8008fa2d8 100755 --- a/t/t1011-read-tree-sparse-checkout.sh +++ b/t/t1011-read-tree-sparse-checkout.sh @@ -17,17 +17,19 @@ test_expect_success 'setup' ' cat >expected <<-\EOF && 100644 77f0ba1734ed79d12881f81b36ee134de6a3327b 0 init.t 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 sub/added + 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 subsub/added EOF cat >expected.swt <<-\EOF && H init.t H sub/added + H subsub/added EOF test_commit init && echo modified >>init.t && - mkdir sub && - touch sub/added && - git add init.t sub/added && + mkdir sub subsub && + touch sub/added subsub/added && + git add init.t sub/added subsub/added && git commit -m "modified and added" && git tag top && git rm sub/added && @@ -81,6 +83,7 @@ test_expect_success 'match directories with trailing slash' ' cat >expected.swt-noinit <<-\EOF && S init.t H sub/added + S subsub/added EOF echo sub/ > .git/info/sparse-checkout && @@ -105,6 +108,7 @@ test_expect_success 'checkout area changes' ' cat >expected.swt-nosub <<-\EOF && H init.t S sub/added + S subsub/added EOF echo init.t >.git/info/sparse-checkout && From 60aa9cf8f370b69eb7feaad2e1cbcd04280bc799 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 9 Nov 2010 11:12:48 -0600 Subject: [PATCH 2/2] Documentation: document show -s Git's diff machinery has supported a -s (silence diff output) option as far back as v0.99~900 (Silent flag for show-diff, 2005-04-13), but the option is only advertised in an odd corner of the git diff-tree manual. The main use is to retrieve basic metadata about a commit: git show -s rev Explain this in the 'git log' manual and provide an example in the 'git show' examples section. This is kind of a cop-out, since it would be more useful to explain it in the 'git show' manual proper, which says: The command takes options applicable to the git diff-tree command to control how the changes the commit introduces are shown. This manual page describes only the most frequently used options. Fixing that is a larger task for another day. Reported-by: Will Hall Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-show.txt | 4 ++++ Documentation/rev-list-options.txt | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Documentation/git-show.txt b/Documentation/git-show.txt index 2049c60f7..f0a8a1aff 100644 --- a/Documentation/git-show.txt +++ b/Documentation/git-show.txt @@ -54,6 +54,10 @@ git show v1.0.0:: git show v1.0.0^\{tree\}:: Shows the tree pointed to by the tag `v1.0.0`. +git show -s --format=%s v1.0.0^\{commit\}:: + Shows the subject of the commit pointed to by the + tag `v1.0.0`. + git show next~10:Documentation/README:: Shows the contents of the file `Documentation/README` as they were current in the 10th last commit of the branch diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index 7a4256706..1aaaf5ae8 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -146,6 +146,9 @@ options may be given. See linkgit:git-diff-files[1] for more options. -t:: Show the tree objects in the diff output. This implies '-r'. + +-s:: + Suppress diff output. endif::git-rev-list[] Commit Limiting