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

Re: Re* [RFC/PATCH] extend meaning of "--root" option to index comparisons

From
Anatol Pomozov <anatol.pomozov@gmail.com>
Date
Sep 21, 2008, 15:58 UTC
Message-ID
<3665a1a00809210858r1c494d22p77b5e9964c06424e@mail.gmail.com>
In-Reply-To
<20080921135616.GA25238@sigill.intra.peff.net>
Hi,

Jeff mostly explained what I expect from 'git log' and I agree with him. We ('git log' 'git rev-parse' ...) should separate cases when revision is broken (like we have a junk in the HEAD file) from the case when "branch is not created yet" (which is part of normal workflow).

What about following algorithm. HEAD points to ref and ref is not
created yet. Additional check could be
 a) there are no other refs
 or/and b) object database is empty
Show 13 quoted lines
>> -     argc = setup_revisions(argc, argv, rev, "HEAD");
>> +     argc = setup_revisions(argc, argv, rev, NULL);
>> +     if (!rev->pending.nr) {
>> +             add_head_to_pending(rev);
>> +             if (!rev->pending.nr) {
>> +                     printf("No commits (yet).\n");
>> +                     exit(0);
>> +             }
>> +     }
>
> I like the idea of an improved message, but such a message should
> definitely not go to stdout; it would feed nonsense to a command like
> "git log | my_log_filter".

+1 here. By default 'git log' should not output anything in this case, even "No commits yet". Although such message would be fine for something like "git log --verbose"

-- 
anatol
Previous: Jeff KingNext: Jakub Narebski
Message 18 of 22 in “Diff-tree does not work for initial commit”
  1. Anatol PomozovSep 15, 2008
  2. Michael J GruberSep 15, 2008
  3. Junio C HamanoSep 15, 2008
  4. Anatol PomozovSep 15, 2008
  5. Michael J GruberSep 15, 2008
  6. Sverre RabbelierSep 15, 2008
  7. Jeff KingSep 15, 2008
  8. Sverre RabbelierSep 16, 2008
  9. Jeff KingSep 16, 2008
  10. extend meaning of "--root" option to index comparisonsJeff King, Sep 18, 2008
  11. Anatol PomozovSep 18, 2008
  12. Sverre RabbelierSep 18, 2008
  13. Jeff KingSep 19, 2008
  14. Anatol PomozovSep 19, 2008
  15. Jeff KingSep 19, 2008
  16. Re* [RFC/PATCH] extend meaning of "--root" option to index comparisonsJunio C Hamano, Sep 19, 2008
  17. Jeff KingSep 21, 2008
  18. Anatol PomozovSep 21, 2008
  19. Jakub NarebskiSep 21, 2008
  20. Jeff KingSep 22, 2008
  21. Re* [RFC/PATCH] extend meaning of "--root" option to index comparisonsJunio C Hamano, Sep 21, 2008
  22. Jeff KingSep 22, 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.