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

Re: Suggestion: make --left-right work with --merge

From
Paul Mackerras <paulus@samba.org>
Date
Mar 1, 2008, 07:39 UTC
Message-ID
<18377.2084.30531.202087@cargo.ozlabs.ibm.com>
In-Reply-To
<7vfxvbd0nu.fsf@gitster.siamese.dyndns.org>
Junio C Hamano writes:
> Try it on user inputs like "master..next", "next...master".  You
> wanted to grab only the positive ones, no?

No... gitk passes the IDs it gets from git rev-parse (both positive and negative) to git log, rather than the original arguments. This is to avoid gitk having an incorrect idea about what commits git log has started from, in the situation where somebody changes some head or tag between when gitk does the git rev-parse and when it does the git log.

That unfortunately means --left-right doesn't work however, because git log doesn't recognize "a b ^merge_base(a,b)" as being equivalent to "a...b".

Show 15 quoted lines
> And in order to handle them sanely without worrying about
> revision machinery and rev-parse going out-of-sync, I would
> almost suggest doing something like the attached patch and say:
> 
> 	$ git rev-list --no-walk "$@"
> 
> The user options can contain --left-right and --boundary, so the
> output from this could begin with ">", "<" and "-".  If you
> discard the ones that are prefixed with "-" (i.e. the user had
> the --boundary option in "$@"), grab the ones that are not
> prefixed (i.e. the user did not have the --left-right option in
> "$@"), and the ones prefixed with ">" and "<" (i.e. the user did
> have --left-right, and you would strip the prefix from such a
> line), you would find all positive ones the user specified, I
> think.

Yes, that would be useful. Now, if I can just think of a way to avoid the race, or work around it, the problem will be solved. :) I can probably do that by checking whether I see all the (positive) commits from git rev-list --no-walk in the git log output.

Thanks, Paul.

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 13 in “Suggestion: make --left-right work with --merge”
  1. Paul MackerrasFeb 27, 2008
  2. Junio C HamanoFeb 27, 2008
  3. Paul MackerrasFeb 27, 2008
  4. Junio C HamanoFeb 27, 2008
  5. Paul MackerrasFeb 28, 2008
  6. Junio C HamanoFeb 29, 2008
  7. Paul MackerrasFeb 29, 2008
  8. Junio C HamanoFeb 29, 2008
  9. Paul MackerrasMar 1, 2008
  10. Junio C HamanoMar 1, 2008
  11. Paul MackerrasMar 1, 2008
  12. Linus TorvaldsFeb 29, 2008
  13. Junio C HamanoFeb 29, 2008

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.