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

Re: Are these bugs?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 28, 2008, 01:20 UTC
Message-ID
<7vwsi2j5q6.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080828010458.GE12354@leksak.fem-net>
Stephan Beyer <s-beyer@gmx.net> writes:
Show 12 quoted lines
> Junio C Hamano wrote:
> 
>> "Jay Soffian" <jaysoffian@gmail.com> writes:
>> 
>> > I understand why "git reset" failed, but at best the error message is
>> > confusing to a new user.
>> 
>> This is in "patches welcome" category.
>
> <noise>
> But I still think it's stupid.
> </noise>

Yes I think it is stupid. The dummy commit does not change the fact that you need to special case it anyway, and special casing you can do without the dummy commit that will contaminate the history. We already have such special case for "log -p" (--root used to be optional). If rebasing onto emptiness is problematic, the command should be taught how.

> So, for a patch, is it sane to just remove/clear the index
> if get_sha1("HEAD", sha1) fails?
As a general idea, yes, but details matter.

If the user says "git reset [--hard/--soft/--mixed] HEAD" from the command line, we should say "You do not even have HEAD commit". If "git reset" deduced (incorrectly) that the user meant HEAD, and only in that case, we should clear the index.

Previous: Stephan BeyerNext: Benny Halevy
Message 4 of 6 in “Are these bugs?”
  1. Jay SoffianAug 27, 2008
  2. Junio C HamanoAug 27, 2008
  3. Stephan BeyerAug 28, 2008
  4. Junio C HamanoAug 28, 2008
  5. Benny HalevyAug 28, 2008
  6. Jay SoffianAug 28, 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.