shithub: git9

Download patch

ref: d566599a9eeddc39e661284fe8e72fb3f6c149b8
parent: 8f449d48dd668d9b23b4fffaa275d57775e9afd5
author: Michael Forney <[email protected]>
date: Sun Jan 31 18:33:56 EST 2021

git/query: exclude left endpoint from range

This is closer to git behavior and is more flexible since the original
behavior can be recovered with a~..b, but not the other way around.

git/rebase needs these semantics since we do not want to include the
common ancestor in the list of commits to import onto the new base.
The new base may be newer than the oldest commit in the import list,
so it can appear anywhere in the current git/query output and cannot
be pruned by git/rebase itself.

--- a/git.1.man
+++ b/git.1.man
@@ -514,9 +514,9 @@
 .B a
 and
 .B b.
-Between is defined as the set of all commits which are ancestors of
+Between is defined as the set of all commits which are reachable from
 .B b
-and descendants of
+but not reachable from
 .B a.
 
 .SH PROTOCOLS
--- a/ref.c
+++ b/ref.c
@@ -415,6 +415,7 @@
 	mark = ev->nstk;
 	osinit(&keep);
 	osinit(&skip);
+	osadd(&keep, a);
 	while(1){
 		all = earealloc(all, (nall + 1), sizeof(Object*));
 		idx = earealloc(idx, (nall + 1), sizeof(int));