git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Brent Casavant <brent.casavant@hpe.com>
To: git@vger.kernel.org
Subject: bug: "rev-parse --short" with "--not --remote"
Date: Fri, 11 Oct 2019 15:10:33 -0500	[thread overview]
Message-ID: <83e4f54f-190b-115f-b31b-7177c681128b@hpe.com> (raw)

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

             reply	other threads:[~2019-10-11 20:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 20:10 Brent Casavant [this message]
2019-10-11 20:58 ` bug: "rev-parse --short" with "--not --remote" Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83e4f54f-190b-115f-b31b-7177c681128b@hpe.com \
    --to=brent.casavant@hpe.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).