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

Re: [PATCH 3/3] rev-list: add --allow-missing-tips to be used with --missing=...

From
LALinus Arver <linusa@google.com>
Date
Feb 7, 2024, 09:57 UTC
Message-ID
<owlyttmkmwaf.fsf@fine.c.googlers.com>
In-Reply-To
<CAP8UFD3Hfgud19y_K1bZOudkBE-ss1_SgWTRVkJ7gUbYJ400yQ@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 24 quoted lines
> On Thu, Feb 1, 2024 at 10:27 PM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> Christian Couder <christian.couder@gmail.com> writes:
>>
>> > When such a command is used to find the dependencies of some objects,
>> > for example the dependencies of quarantined objects, it would be
>> > better if the command would instead consider such missing objects,
>> > especially commits, in the same way as other missing objects.
>> >
>> > If, for example `--missing=print` is used, it would be nice for some
>> > use cases if the missing tips passed as arguments were reported in
>> > the same way as other missing objects instead of the command just
>> > failing.
>> >
>> > Let's introduce a new `--allow-missing-tips` option to make it work
>> > like this.
>>
>> An obvious question is if this even needs to be a new option.  What
>> are expected use cases where --missing=print without this option is
>> beneficial?
>
> I am not sure if such a case is really beneficial but some
> people/script/forges might rely on an error from `git rev-list
> --missing=print` to propagate back an error to some user interface.

I currently learn toward just making the new flag's behavior be absorved into the existing "--missing=..." flag. Nevertheless, you raise an interesting concern.

Perhaps a compromise would be to make "--missing=..." learn the new behavior of this patch as Junio suggested, but to introduce a new flag, something like "--fail-on-missing-tips" to fail early if any of the tip commits' objects are missing? That way we could keep the current "strict" behavior of complaining if we feed rev-list any tips whose objects are missing. And for the vast majority of cases the "--missing=..." flag could (intuitively) gracefully handle tips with missing objects and you wouldn't have to pass in the additional flag.

IOW, make the minority (certainly not majority, I think?) of users who really need the error propagation use the (new) extra flag, while the rest of us (including the version of you who was surprised by the limited behavior of "--missing=...", enough to write this series) don't have to.

Thanks.
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 20 in “rev-list: allow missing tips with --missing”
  1. 0/3 rev-list: allow missing tips with --missingChristian Couder, Feb 1, 2024
  2. 1/3 revision: clarify a 'return NULL' in get_reference()Christian Couder, Feb 1, 2024
  3. Eric SunshineFeb 1, 2024
  4. Christian CouderFeb 1, 2024
  5. 2/3 t6022: fix 'even though' typo in commentChristian Couder, Feb 1, 2024
  6. 3/3 rev-list: add --allow-missing-tips to be used with --missing=...Christian Couder, Feb 1, 2024
  7. Junio C HamanoFeb 1, 2024
  8. Christian CouderFeb 2, 2024
  9. Junio C HamanoFeb 2, 2024
  10. Junio C HamanoFeb 1, 2024
  11. Christian CouderFeb 2, 2024
  12. Junio C HamanoFeb 2, 2024
  13. Linus ArverFeb 7, 2024
  14. Junio C HamanoFeb 7, 2024
  15. Christian CouderFeb 7, 2024
  16. Linus ArverFeb 7, 2024
  17. Christian CouderFeb 7, 2024
  18. Linus ArverFeb 7, 2024
  19. Christian CouderFeb 8, 2024
  20. Linus ArverFeb 8, 2024

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.