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

Possible bug in `git reset` in 1.9

From
JCJames Coleman <jtc331@gmail.com>
Date
Jun 18, 2014, 17:01 UTC
Message-ID
<CAAaqYe9FcjE9v+bkcnkPim8ntFvbUy72dJJCGs7974dq_9eSOw@mail.gmail.com>
Suppose I have the following branches:
* branch-1 with commits A - B - C
* branch-2 with commits A - B - C - D

Prior to version 1.9, running `git reset --hard D` while branch-1 is checked out will result in changing the current branch HEAD to commit hash D (essentially what update-ref would do).

In 1.9.1 (I haven't tested on 1.9.0 yet), however, running `git reset --hard D` while branch-1 is checked out will result in the following output: $ fatal: Could not parse object 'D'

I assume that this is not an expected change as nothing about changes to the reset command is present in the change log for 1.9.0 or 1.9.0. Is this a bug or was the previous behavior unexpected as well? Either way, it's a regression in terms of what can be expected based on previous version.

Next: James Coleman
Message 1 of 2 in “Possible bug in `git reset` in 1.9”
  1. James ColemanJun 18, 2014
  2. James ColemanJun 18, 2014

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.