git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rev-list --ancestry-path with arg - bug or undocumented requirement
@ 2024-11-19 21:53 Kai Koponen
  2024-11-20  3:22 ` Elijah Newren
  0 siblings, 1 reply; 15+ messages in thread
From: Kai Koponen @ 2024-11-19 21:53 UTC (permalink / raw)
  To: git

What did you do before the bug happened? (Steps to reproduce your issue)
Create a toy repo with commits in the following structure:
A - B - C
     \
      D

Run `git rev-list --ancestry-path=D A..C`.

What did you expect to happen? (Expected behavior)
Commits A and B should be listed.

What happened instead? (Actual behavior)
No commits listed.

What's different between what you expected and what actually happened?
--ancestry-path with a commit arg seems to return 0 results unless the
specified commit is itself part of the range. The rev-list documentation
does not mention that this is a requirement.


[System Info]
git version:
git version 2.47.0.338.g60cca15819-goog
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
libcurl: 8.8.0
OpenSSL: OpenSSL 3.3.2 3 Sep 2024
zlib: 1.3
compiler info: gnuc: 13.2
libc info: glibc: 2.38
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
commit-msg
pre-commit
prepare-commit-msg

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH] doc: mention rev-list --ancestry-path restrictions
@ 2024-12-03 20:18 Kai Koponen via GitGitGadget
  2024-12-03 22:22 ` Elijah Newren
  2024-12-04  0:10 ` Junio C Hamano
  0 siblings, 2 replies; 15+ messages in thread
From: Kai Koponen via GitGitGadget @ 2024-12-03 20:18 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Kristoffer Haugsbakk, Kai Koponen, Kai Koponen

From: Kai Koponen <kaikoponen@google.com>

The rev-list documention doesn't mention that the given
commit must be in the specified commit range, leading
to unexpected results.

Signed-off-by: Kai Koponen <kaikoponen@google.com>
---
    doc: mention rev-list --ancestry-path restrictions

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1838%2Fgkaikoponen%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1838/gkaikoponen/master-v1
Pull-Request: https://github.com/git/git/pull/1838

 Documentation/rev-list-options.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 00ccf687441..459e5a02f52 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -412,7 +412,8 @@ Default mode::
 
 --ancestry-path[=<commit>]::
 	When given a range of commits to display (e.g. 'commit1..commit2'
-	or 'commit2 {caret}commit1'), only display commits in that range
+	or 'commit2 {caret}commit1'), and a commit <commit> in that range,
+	only display commits in that range
 	that are ancestors of <commit>, descendants of <commit>, or
 	<commit> itself.  If no commit is specified, use 'commit1' (the
 	excluded part of the range) as <commit>.  Can be passed multiple

base-commit: cc01bad4a9f566cf4453c7edd6b433851b0835e2
-- 
gitgitgadget

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

end of thread, other threads:[~2024-12-04  0:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19 21:53 rev-list --ancestry-path with arg - bug or undocumented requirement Kai Koponen
2024-11-20  3:22 ` Elijah Newren
2024-12-02 19:45   ` Kai Koponen
2024-12-02 23:48     ` Elijah Newren
2024-12-03  1:05     ` Junio C Hamano
2024-12-03 17:14       ` [PATCH] doc: mention rev-list --ancestry-path restrictions Kai Koponen
2024-12-03 17:38         ` Kristoffer Haugsbakk
2024-12-03 17:59           ` Kai Koponen
2024-12-03 20:21             ` Kai Koponen
2024-12-03 23:33           ` Junio C Hamano
2024-12-03 23:36             ` Kai Koponen
2024-12-03 23:24         ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2024-12-03 20:18 Kai Koponen via GitGitGadget
2024-12-03 22:22 ` Elijah Newren
2024-12-04  0:10 ` Junio C Hamano

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).