Re: What's cooking in git.git (Apr 2021, #05; Mon, 19)
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Apr 21, 2021, 08:26 UTC
- Message-ID
- <87tuo02gdd.fsf@evledraar.gmail.com>
- In-Reply-To
- <YH9gPt410QBRjG59@camp.crustytoothpaste.net>
On Wed, Apr 21 2021, brian m. carlson wrote:
Show 14 quoted lines
> On 2021-04-20 at 13:52:33, Ævar Arnfjörð Bjarmason wrote: >> This has a textual conflict (no longer a semantic one) with the above >> ab/unexpected-object-type etc. >> >> As noted in >> https://lore.kernel.org/git/87mttx121j.fsf@evledraar.gmail.com/ I had >> questions about the approach in hash-object.c, in particular I have >> POC/WIP patches that make one of brian's TODO tests pass, by doing the >> "we are in SHA256 mode" earlier, which is also less code as we won't >> need to add special handling to a large part of hash-object.c (or, in >> the future, other such commands). > > I'm going to drop those first two patches for now, since I plan to > implement them in a different way in the future.
Using something like the:
git --object-format=sha256 <cmd>
Approch I suggsted in https://lore.kernel.org/git/8735vq2l8a.fsf@evledraar.gmail.com/ ?
In any case having something like the OPT_OBJECT_FORMAT() I added in that WIP patch would make sense wouldn't it, to reduce the duplication of current "object-format". It would also save each current caller from doing the "unknown" and other sanity checks, since they could rely on parse_options() having died in that case.