git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git commands version documentation
@ 2022-05-22 18:41 Hrushikesh Rao
  2022-05-22 22:02 ` Philip Oakley
  0 siblings, 1 reply; 7+ messages in thread
From: Hrushikesh Rao @ 2022-05-22 18:41 UTC (permalink / raw)
  To: git

Hey,

I am working on git maintenance project in Jenkins. We are using 
git-maintenance to improve the performance of the git commands further 
improving the build speed. Git maintenance was added in git version 
2.30.0. The aim of the project is to also support systems having git 
version < 2.30.0. Few git maintenance tasks very available before the 
maintenance command was introduced i.e gc,commit-graph,gc and 
incremental repack. Is there a way for me to find out in which version 
these commands have been introduced? Based on this we can support legacy 
git version.

Waiting for your response.

Thank You

Hrushikesh Rao Naidnur


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Git commands version documentation
  2022-05-22 18:41 Git commands version documentation Hrushikesh Rao
@ 2022-05-22 22:02 ` Philip Oakley
  2022-05-22 23:35   ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Philip Oakley @ 2022-05-22 22:02 UTC (permalink / raw)
  To: Hrushikesh Rao, git

On 22/05/2022 19:41, Hrushikesh Rao wrote:
> Hey,
>
> I am working on git maintenance project in Jenkins. We are using
> git-maintenance to improve the performance of the git commands further
> improving the build speed. Git maintenance was added in git version
> 2.30.0. The aim of the project is to also support systems having git
> version < 2.30.0. Few git maintenance tasks very available before the
> maintenance command was introduced i.e gc,commit-graph,gc and
> incremental repack. 

> Is there a way for me to find out in which version these commands have
> been introduced? Based on this we can support legacy git version.

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

--
Philip

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Git commands version documentation
  2022-05-22 22:02 ` Philip Oakley
@ 2022-05-22 23:35   ` Junio C Hamano
  2022-05-23 11:10     ` Philip Oakley
  0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2022-05-22 23:35 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Hrushikesh Rao, git

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?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Git commands version documentation
  2022-05-22 23:35   ` Junio C Hamano
@ 2022-05-23 11:10     ` Philip Oakley
  2022-05-23 13:08       ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 7+ messages in thread
From: Philip Oakley @ 2022-05-23 11:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Hrushikesh Rao, git

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.

Philip

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Git commands version documentation
  2022-05-23 11:10     ` Philip Oakley
@ 2022-05-23 13:08       ` Ævar Arnfjörð Bjarmason
  2022-05-23 15:19         ` Philip Oakley
  0 siblings, 1 reply; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-23 13:08 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Junio C Hamano, Hrushikesh Rao, git


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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Git commands version documentation
  2022-05-23 13:08       ` Ævar Arnfjörð Bjarmason
@ 2022-05-23 15:19         ` Philip Oakley
  2022-05-23 18:01           ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 7+ messages in thread
From: Philip Oakley @ 2022-05-23 15:19 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Junio C Hamano, Hrushikesh Rao, git

Hi Ævar

On 23/05/2022 14:08, Ævar Arnfjörð Bjarmason wrote:
> 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. 

"we?"
> 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.

I think you've picked up the wrong essence of my answer, which was to
Hrushikesh's question that asked "how could _they_ find out when various
_particular_ maintenance commands (and by implication some options) were
released?". It wasn't any all-singing all-dancing solution to some other
problem, as I understood it.
>
> 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.

corelist(1) is not something I'm familiar with, but looks like it might form the basis for a discussion about such a UX interface.

>
> 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.

That "wouldn't be a pain to maintain" is probably the core of any such
design..
>
> 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.

Implicit in this is the choice between parsing the code, or the
documentation, to determine when options started appearing.
>
> 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.
In some ways it sounds very similar to the i18n efforts where the
'database' grows with every release. Though capturing the historic
release progression is probably the hardest part.

--
Philip



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Git commands version documentation
  2022-05-23 15:19         ` Philip Oakley
@ 2022-05-23 18:01           ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-23 18:01 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Junio C Hamano, Hrushikesh Rao, git


On Mon, May 23 2022, Philip Oakley wrote:

> Hi Ævar
>
> On 23/05/2022 14:08, Ævar Arnfjörð Bjarmason wrote:
>> 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. 
>
> "we?"

We as a project.

>> 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.
>
> Implicit in this is the choice between parsing the code, or the
> documentation, to determine when options started appearing.

By "extracted from the parse-options reflection" I mean that you could
script this around the same facility we use to dump what options we
support for the bash completion.

See parse-options.c, all users of the API support a hidden option to
dump their supported options, and likewise git.c can dump built-ins and
other known lists of commands.

So in theory this sort of thing should be a relativel simple for-loop
that builds our release tags, for each successful builds lists the
built-ins, and for each of those lists the options.

The options being a bonus, it would already be useful if it just did
command.

> In some ways it sounds very similar to the i18n efforts where the
> 'database' grows with every release. Though capturing the historic
> release progression is probably the hardest part.

As long as we can still build that release it should be pretty easy...


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-23 18:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 18:41 Git commands version documentation Hrushikesh Rao
2022-05-22 22:02 ` Philip Oakley
2022-05-22 23:35   ` Junio C Hamano
2022-05-23 11:10     ` Philip Oakley
2022-05-23 13:08       ` Ævar Arnfjörð Bjarmason
2022-05-23 15:19         ` Philip Oakley
2022-05-23 18:01           ` Ævar Arnfjörð Bjarmason

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).