Re: [PATCH 1/3] show-index: implement automatic hash detection
- From
Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com>
- Date
- Jan 23, 2026, 16:08 UTC
- Message-ID
- <20260123161017.37827-1-shreyanshpaliwalcmsmn@gmail.com>
- In-Reply-To
- <aXMh0pYw2ZrptCNj@pks.im>
> That would be a regression for users that currently _can_ run > git-show-index(1) outside of a repository with a SHA-1 based index. It's > not going to be a common use case, but I wouldn't be surprised if there > was at least one user out there that we'd break with such a change.
That makes sense, but relying on a silent SHA-1 fallback purely because we are outside of a repository still feels a bit ambiguous to me. It works today mostly because SHA-1 has historically been the default, but if in future git introduces additional hash functions or if SHA-256 indexes become more relevant to this particular usage.
Though, I think based on the discussion so far, we can only show a warning like this along with the SHA-1 fallback like this,
warning(_("assuming SHA-1; use --object-format to override"));Do you think if this would be appropriate, or if anything better can be done to handle this or is it just better to leave the behavior as-is. Let me know :)
Best, Shreyansh