From: Ævar Arnfjörð Bjarmason Date: Mon, 04 Feb 2019 23:50:23 GMT Subject: Re: [RFC/PATCH] core.abbrev doc: document and test the abbreviation length Message-ID: <87r2cnkta8.fsf@evledraar.gmail.com> In-Reply-To: <20190204233235.GB2366@sigill.intra.peff.net> On Tue, Feb 05 2019, Jeff King wrote: > On Mon, Feb 04, 2019 at 12:04:21PM -0800, Junio C Hamano wrote: > >> Instead of exposing this pretty-much "test-only" feature as a new >> option to t/helper/test-tool, I think it is OK, if not even better, >> to have it in rev-parse proper like this patch does. >> >> I however have a mildly strong suspition that people would expect >> "rev-parse --abbrev-len=" to be a synonym of "--short=" >> >> As this is pretty-much a test-only option, perhaps going longer but >> more descriptive would make sense? >> >> git rev-parse --compute-abbrev-length-for >> >> may be an overkill, but something along those lines. > > You could even default to the number of objects in the > repository. Which implies that perhaps the best spot is the command > where we already count the number of objects, git-count-objects. That's documented as reporting loose objects by default, although it has a full report with -v. Maybe rev-parse isn't the right place, I just picked it because it seems to be the general utility belt for stuff that doesn't fit elsewhere. But putting it in git-count-objects seems like a bit more of a stretch given the above.