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

bug: "rev-parse --short" with "--not --remote"

From
BCBrent Casavant <brent.casavant@hpe.com>
Date
Oct 11, 2019, 20:10 UTC
Message-ID
<83e4f54f-190b-115f-b31b-7177c681128b@hpe.com>
Hello,
I noticed what appears to be a bug in rev-parse with an admittedly somewhat unusual combination of arguments.
Compare the output of the following:

% git rev-parse HEAD --not --remotes=origin 3de09080eb219149a8596dc21915d5a496cba171 ^4fb157bf360413fe3fad38d03b02ce7232d12961 ^757cfa6938c3d510d1597096d9f0b6878b884270

To this:

% git rev-parse --short HEAD --not --remotes=origin ^4fb157b ^757cfa6 ^3de0908

In the first case rev-parse emits the commit-id of HEAD, followed by negated commit-ids of all remote branches in origin.  I believe this is the correct and intended behavior.
In the second case rev-parse emits the negated short commit-ids of all remote branches in origin, followed by the negated short commit-id of HEAD.  This is inconsistent with the results of the (presumably correct) prior example.
I would expect both commands to emit the same output, modulo the number of characters emitted for the commit-id.

Thank you, Brent Casavant

-- 
Brent Casavant
Hewlett Packard Enterprise
Next: Jeff King
Message 1 of 2 in “bug: "rev-parse --short" with "--not --remote"”
  1. Brent CasavantOct 11, 2019
  2. Jeff KingOct 11, 2019

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.