How to select git commit ranges with inclusive end points -
i need specify commits downstream of 1st commit in git repo.
i trying run command:
$ git filter-branch --index-filter 'git rm --ignore-unmatch --cached some/path/file' -- 33e0331^.. and getting:
fatal: ambiguous argument '33e0331^..': unknown revision or path not in working tree. use '--' separate paths revisions, this: 'git <command> [<revision>...] -- [<file>...]' because 33e0331 first commit in repo. how do ?
just don't specify starting point. if master, example, implies "everything reachable master". ability include starting point designate "early history" exclude.
while should address scenario you've put forward, more general answer title question: can't. don't really specify "ranges of commits" (as people intuitively define it) @ all.
the range notation convenience, can misleading. in non-trivial cases, can useful remember can specify (a) reachable commit should excluded, or (b) reachable commit should included. there multiple notations each. a..b means "exclude reachable a, other include reachable b"; it's shorthand ^a b (and, interestingly, it's not shorter...)
now in simple case, looks range of commits
x1 -- x2 -- -- o1 -- o2 -- b -- x3 -- x4 in such simple case, kinda-sotta make "inclusive range" using "parent-of" notation tried (^a^ b or a^..b).
if a root, in example:
a -- o1 -- o2 -- b -- x1 -- x2 still a..b means include os , b. "inclusive" range, omit starting point in original form of answer. b include a, os, , b.
you can stretch definition of "range" little bit:
x1 -- x2 -- \ o1 -- o2 -- b here, a..b (which, again, ^a b) again include os , b. may seem "starting point" not upstream of b, exclude reachable from a, includes xs
so now, "inclusive range" mean?
this common usage of .. notation, because allows peal commits branch away commits of "parent branch". (i "parent branch" in quotes, because not thing git. it's common interpretation of branch topology.)
but can lose mind trying think of a..b "range" like
x1 -- -- o1 -- o2 -- b <--(master) / o3 -- o4 now why o3 , o4 not x2 , x3? aren't in "range" a b...? well, aren't reachable a, , reachable b, included. range (as might intuitively understand it) have ^a ^o4 b
Comments
Post a Comment