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

Re: Suspected bug on `git -C <rp> rev-list --all` where <rp> has 0 commits

From
Atousa Duprat <atousa.p@gmail.com>
Date
Nov 25, 2015, 06:56 UTC
Message-ID
<CA+izobv6OuAAjnKH5A=vcmJh3yDhWi41WAD-OmVSN2d7P_5SGA@mail.gmail.com>
In-Reply-To
<20151111192634.629102e6@linux-apw9.site>

I agree with Yac that this error is unwarranted, though it's been like that since forever. If a repo is empty, git rev-list should probably just return without erroring out. The fix is trivial, if the list agrees that this is in fact legit.

Atousa
On Wed, Nov 11, 2015 at 10:26 AM, yac <yac@blesmrt.net> wrote:
Show 64 quoted lines
> Hello
>
> basics:
>
> % rpm -q git git-core
> git-2.6.2-2.1.x86_64
> git-core-2.6.2-2.1.x86_64
>
> ~ % grep PRETTY_NAME /etc/os-release
> PRETTY_NAME="openSUSE Tumbleweed (20151030) (x86_64)"
>
> current behavior:
>
> ~ % git init no-commits
> Initialized empty Git repository in /home/tester/no-commits/.git/
> ~ % git -C no-commits rev-list --all
> usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
>   limiting output:
>     --max-count=<n>
>     --max-age=<epoch>
>     --min-age=<epoch>
>     --sparse
>     --no-merges
>     --min-parents=<n>
>     --no-min-parents
>     --max-parents=<n>
>     --no-max-parents
>     --remove-empty
>     --all
>     --branches
>     --tags
>     --remotes
>     --stdin
>     --quiet
>   ordering output:
>     --topo-order
>     --date-order
>     --reverse
>   formatting output:
>     --parents
>     --children
>     --objects | --objects-edge
>     --unpacked
>     --header | --pretty
>     --abbrev=<n> | --no-abbrev
>     --abbrev-commit
>     --left-right
>     --count
>   special purpose:
>     --bisect
>     --bisect-vars
>     --bisect-all
> ~ % echo $?
> 129
>
> expected behavior:
>
> ~ % git -C no-commits rev-list --all
> ~ % echo $?
> 0
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: yacNext: atousa.p@gmail.com
Message 2 of 5 in “Suspected bug on `git -C <rp> rev-list --all` where <rp> has 0 commits”
  1. yacNov 11, 2015
  2. Atousa DupratNov 25, 2015
  3. git rev-list doesn't complain when repo is emptyatousa.p@gmail.com, Nov 25, 2015
  4. Jeff KingNov 25, 2015
  5. Jeff KingNov 25, 2015

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.