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

Re: bug in git-revert

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 2, 2008, 07:00 UTC
Message-ID
<alpine.LSU.1.00.0803020659340.22527@racer.site>
In-Reply-To
<20080302064449.GA6334@coredump.intra.peff.net>
Hi,
On Sun, 2 Mar 2008, Jeff King wrote:
Show 19 quoted lines
> In 9509af6 (Make git-revert & git-cherry-pick a builtin), you introduced
> the following code:
> 
>    252          } else {
>    253                  struct wt_status s;
>    254
>    255                  if (get_sha1("HEAD", head))
>    256                          die ("You do not have a valid HEAD");
>    257                  wt_status_prepare(&s);
>    258                  if (s.commitable || s.workdir_dirty)
>    259                          die ("Dirty index: cannot %s", me);
>    260                  discard_cache();
>    261          }
> 
> (where the die condition was later changed to allow a dirty workdir). Am
> I crazy, or is it impossible to trigger either of those conditions?
> wt_status_prepare is about setting up the object to do the actual diff.
> At that point it hasn't actually looked at the index or file contents,
> and so commitable is _always_ 0.

Well, then this is my mistake. I haven't looked closely at what wt_status_prepare() does (or did).

Ciao, Dscho

Previous: Jeff KingNext: Jeff King
Message 2 of 7 in “bug in git-revert”
  1. Jeff KingMar 2, 2008
  2. Johannes SchindelinMar 2, 2008
  3. Jeff KingMar 2, 2008
  4. revert: actually check for a dirty indexJeff King, Mar 2, 2008
  5. Alex RiesenMar 2, 2008
  6. Jeff KingMar 3, 2008
  7. Junio C HamanoMar 3, 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.