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

Re: [PATCH] init-db: support --import to add all files and commit right after init

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Mar 25, 2009, 04:32 UTC
Message-ID
<fcaeb9bf0903242132k71e78219xfda5553854df4a2c@mail.gmail.com>
In-Reply-To
<20090325041934.GA15524@coredump.intra.peff.net>
2009/3/25 Jeff King <peff@peff.net>:
Show 8 quoted lines
>> +-m <message>::
>> +--import=<message>::
>> +
>> +Commit everything to the newly initialized repository. This is equivalent to:
>
> Maybe this is being too lazy, but I think it would be useful to allow
> just "--import" without a message to default to "Initial commit",
> "initial import from `basename $PWD`", or something like that.

I tend to do "commit -q -m i", not a big deal for two more keystrokes. My initial version allowed "git init /path/to/workdir" too so it might be ambiguous for optional message. So all vote for "Initial commit"? Dynamic message seems overkill because most of the cases, this is a throw away repository.

Show 11 quoted lines
>> +             else if (!strcmp(arg, "--import") || !strcmp(arg, "-m")) {
>> +                     if (i+1 >= argc)
>> +                             die("--import requires an import message");
>> +                     import_message = argv[2];
>> +                     i++;
>> +                     argv++;
>> +             }
>
> I seem to recall that we were phasing out "--long-option <arg>" at some
> point, and that all long-options should use "--long-option=". But maybe
> I am mis-remembering.
I did not know too. Any reference?
-- 
Duy
Previous: Jeff KingNext: Jeff King
Message 7 of 10 in “init-db: support --import to add all files and commit right after init”
  1. init-db: support --import to add all files and commit right after initNguyễn Thái Ngọc Duy, Mar 25, 2009
  2. Shawn O. PearceMar 25, 2009
  3. Nguyen Thai Ngoc DuyMar 25, 2009
  4. Johannes SchindelinMar 25, 2009
  5. Nguyen Thai Ngoc DuyMar 25, 2009
  6. Jeff KingMar 25, 2009
  7. Nguyen Thai Ngoc DuyMar 25, 2009
  8. Jeff KingMar 25, 2009
  9. Miles BaderMar 31, 2009
  10. Jeff KingMar 31, 2009

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.