Re: Git commands version documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 23 2022, Philip Oakley wrote:

> Hi Junio,
>
> On 23/05/2022 00:35, Junio C Hamano wrote:
>> Philip Oakley <philipoakley@iee.email> writes:
>>
>>> One manual method is to look at the history (blame) for the respective
>>> man pages to see when the man page was initially committed, and when
>>> appropriate options were added.
>>>
>>> Maybe use one of the hosting providers GUI if that is your choice e.g.
>>> https://github.com/git/git/blame/master/Documentation/git-gc.txt
>> I got an impression that blame/log is an overkill for the request,
>> which asks for "what tagged version?", to which the answer would be
>> to compare the manual pages for each release (or scan the release
>> notes), perhaps?
>>
>>
>
> I was also concerned as to which way the problem was being addressed:
> was it a need for a cross reference table for all commands, or was it 
> for just a select few?
>
> For me, who likes a good UI, I found the GitHub blame UI quite useful
> when looking at files from the latter direction. It was much easier to 
> scan the blame for the command's documentation page than try and scan
> through the endless release notes. Obviously this does expect that our 
> documentation is fairly complete, at least at the 'mention an option'
> level, even if the occasional nuance didn't reach the docs.
>
>
> I can see that a cli terminal representation is likely to be harder to
> scan, and that some hosters don't provide a blame page, so it would be
> a 'horses for courses' choice.

I think asking a git user to use "git blame" on our own source code is a
non-starter in terms of where we'd like to eventually get. It's not very
friendly, especially in the case of something like the log-family where
option parsing is implemented over more than one file.

Likewise some built-ins don't map to builtin/<name>.c, and all that is
assuming a lot about the user knowing where to look.

I think what the OP here really would like is something similar to
Perl's "corelist(1)" but for Git. I.e. a meta-command you can ask to
tell you what version introduced a given git sub-command, or even option
for that command etc.

Alternatively (or perhaps in addition to that) we could aim to document
this sort of thing, e.g. have an "INTRODUCED IN" section or similar in
the command documentation, or a similar blurb when we discuss various
options.

I have tried to add these sorts of mentions for some past changes,
e.g. the "<refspec>" section in git-fetch(1) is one example (search for
"Git version 2.20").

I think we could do with more of that sort of thing. One difficulty with
doing this in git in particular is that (moreso than most other
projects) when you submit a patch you can't be very certain about what
release it's going to be in, i.e. it might end up cooking for many weeks
& past a release window.

But in any case, I think adding this as a first-class feature (perhaps
to "git help") would be very useful, and it could be done in some way
that wouldn't be a pain to maintain.

E.g. we could carry a text file in our sources with a list of what
commands existed at what versions, and what options they had (as
extracted from the parse-options reflection mechanism). Rather than
manually maintain such a list we could carry a script to that would
attempt to build past releases, for any that were missing we'd attempt
to build them and fill in the gaps.

We could thus make this something (if Junio were willing) that would be
a relatively small addition to pre-release preparations.

For releases that couldn't be built anymore we could either manually
fill in the data, or just not care. What exact version older than 1.8
introduced some command or option is something probably nobody cares
about at this point.

But it is *really useful* when scripting against git to know what
recent-ish release something was introduced in, especially so if we'd
helpfully annotate which releases were known to have been part of major
distro releases, such as RHEL major releases, or OSX's Apple Git etc.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux