git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] git-rev-list.txt: Clarify the use of multiple revision arguments

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Aug 5, 2009, 07:58 UTC
Message-ID
<1249459117-3853-2-git-send-email-git@drmicha.warpmail.net>
In-Reply-To
<1249459117-3853-1-git-send-email-git@drmicha.warpmail.net>

If one thinks of a revision as the set of commits which can be reached from the rev, and of ^rev as the complement, then multiple arguments to git rev-list can be neither understood as the intersection nor the union of the individual sets.

But set language is the natural as well as logical language in which to phrase this. So, add a paragraph which explains multiple arguments using set language.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
While one could explain this also by describing the revision walker,
I think that and/or/union/intersection should be clearer for the average
user.

We may even want to add a paragraph which explains how one gets "A intersected B", which is impossible to do with rev-list.

 Documentation/git-rev-list.txt |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 847cc7d..40ca276 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -66,6 +66,13 @@ command:
 means "list all the commits which are included in 'foo' or 'bar', but
 not in 'baz'".
 
+So, the resulting set of commits is the union of 'foo' and 'bar',
+intersected with the complement of baz. The order of arguments is
+irrelevant: first, the union of all positive refs (those without
+'{caret}') is taken, then the result is intersected with all negative
+refs (i.e. with the complement of the union of all refs which appear
+with a preceding '{caret}').
+
 A special notation "'<commit1>'..'<commit2>'" can be used as a
 short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
 the following may be used interchangeably:
-- 
1.6.4.70.g9c084
Previous: Michael J GruberNext: Junio C Hamano
Message 2 of 4 in “git-rev-list.txt: Correct description for multiple arguments”
  1. 1/2 git-rev-list.txt: Correct description for multiple argumentsMichael J Gruber, Aug 5, 2009
  2. 2/2 git-rev-list.txt: Clarify the use of multiple revision argumentsMichael J Gruber, Aug 5, 2009
  3. Junio C HamanoAug 5, 2009
  4. Michael J GruberAug 6, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.