As show_ref is only ever called on the path where --verify is not
specified, `verify' can never possibly be true here.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 107d
Move handling of -d into show_one, so that it takes effect when
--verify is present as well as when it is absent. This is useful when
the user wishes to avoid the costly iteration of refs.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 23 ---
t/t1403-show
Do the same with --quiet as was done with -d, to remove the need to
perform this check at show_one's call site from the --verify branch.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/builtin/show-re
not work as expected.
Instead of insisting that the input begins with "refs/", allow "HEAD"
as well in the codepath that handles "--verify", so that all valid
full refnames including HEAD are passed to the same output machinery.
Signed-off-by: Vladimir Panteleev
---
Move detection of dangling refs into show_one, so that they are
detected when --verify is present as well as when it is absent.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 16
t/t1403-show-ref.sh | 22 ++
2 files changed, 30 insertions(+), 8
Third iteration, according to Junio's comments. This time we keep
show_ref and show_one separate, accept HEAD with --verify even without
--head, and add tests for dangling ref validation with --verify.
As the small function is now only called from a single place, there is
no point in keeping it as a separate function any longer.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 15 +--
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/builtin/show-ref.c b
t all valid full refnames including HEAD are passed to the same
output machinery.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 3 ++-
t/t1403-show-ref.sh | 14 ++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
ind
alled
with a reference exactly matching pattern.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index bcdc1a95e..3cf344d47 100644
--- a/builtin/show-ref.c
+++ b/builtin/
Use the same output machinery when --verify is absent or present,
which allows tag dereferencing (-d) to work with --verify. This is
useful when the user wishes to avoid the costly iteration of refs.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 3 +--
t/t1403-show-ref.sh | 9
This is the second take for "[PATCH] show-ref: Allow --head to work
with --verify". Thanks to Junio for his extensive feedback.
On 2017-01-20 23:29, Junio C Hamano wrote:
By the way, I have no strong preference between "read-ref, check
quiet and show-one" and "show-ref", so if you make --verify to
consistently call "show_ref()" for both refs/heads/master and HEAD,
that is also perfectly fine.
This sounds like a good ide
On 2017-01-20 19:03, Junio C Hamano wrote:
and viewed in the wider context, I notice that quiet is not honored
in the added code. I think that is easily fixable by replacing this
hunk with something like:
--quiet will still work correctly with the current patch, because
show_ref already check
And to clarify:
On 2017-01-20 20:26, Vladimir Panteleev wrote:
On 2017-01-20 19:03, Junio C Hamano wrote:
Having said all that, using --verify on HEAD does not make much
sense, because if HEAD is missing in .git/, I do not think Git
considers that directory as a Git repository to begin with
Hi Junio,
On 2017-01-20 19:03, Junio C Hamano wrote:
Having said all that, using --verify on HEAD does not make much
sense, because if HEAD is missing in .git/, I do not think Git
considers that directory as a Git repository to begin with. So from
that point of view, I am not sure what value th
l-case
looking up the HEAD ref.
This patch adds --head support to show-ref's --verify logic, by
explicitly checking if the "HEAD" ref is specified when --head is
present.
Signed-off-by: Vladimir Panteleev
---
builtin/show-ref.c | 2 ++
t/t1403-show-ref.sh | 8
2 files ch
16 matches
Mail list logo