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

Re: [Bug] In `git-rev-list(1)`, using the `--objects` flag doesn't work well with the `--not` flag, as non-commit objects are not excluded

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2023, 18:24 UTC
Message-ID
<xmqqbkf6g80f.fsf@gitster.g>
In-Reply-To
<CAOLa=ZQPmtqT9OHxh5uFq0rg+9L02tnmh1UE52em-rXPmFR6yg@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 22 quoted lines
> The provided reproduction recipe unfortunately uses a linear
> history and therefore, is not the same as the example provided by
> me. Here is a reproducible recipe following the same commands you
> used:
> $ rm -fr new ; git init new ; cd new
> $ echo foo >foo
> $ git add -A; git commit -m one; git rev-parse HEAD
> 26fb965d7439c1760677377bf314d8933de0b716
> $ mkdir bar; echo goo >bar/goo
> $ git add -A; git commit -m two; git rev-parse HEAD
> $ git checkout -B branch
> $ git reset --hard @~1
> HEAD is now at 26fb965 one
> $ git add -A; git commit -m three; git rev-parse HEAD
> 91ef508167eb683486c3df6f8d07622b61ed698d
>
> $ git rev-list --objects HEAD ^master
> 91ef508167eb683486c3df6f8d07622b61ed698d
> ff05824d2f76436c61d2c971e11a27514aba6948
> 8baef1b4abc478178b004d62031cf7fe6db6f903 abc
> 086885f71429e3599c8c903b0e9ed491f6522879 bar
> 7a67abed5f99fdd3ee203dd137b9818d88b1bafd bar/goo

Thanks, but the above is not recreating the same as your original (where did "moo" go???). Also "git rev-parse HEAD" for the sanity checking should be spelled "git rev-parse HEAD:" if you want to help others looking into the issue---anybody trying to reproduce will NOT have the same commit object name, but the point of these checks is to show the tree object name, which should reproduce for them.

Previous: Karthik NayakNext: Karthik Nayak
Message 6 of 8 in “[Bug] In `git-rev-list(1)`, using the `--objects` flag doesn't work well with the `--not` flag, as non-commit objects are not excluded”
  1. Karthik NayakAug 15, 2023
  2. Junio C HamanoAug 15, 2023
  3. Taylor BlauAug 15, 2023
  4. Karthik NayakAug 15, 2023
  5. Karthik NayakAug 15, 2023
  6. Junio C HamanoAug 16, 2023
  7. Karthik NayakAug 16, 2023
  8. Junio C HamanoAug 15, 2023

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.