* [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits
@ 2024-02-28 21:09 Ken Matsui
2024-03-08 16:42 ` Patrick Palka
0 siblings, 1 reply; 6+ messages in thread
From: Ken Matsui @ 2024-02-28 21:09 UTC (permalink / raw)
To: gcc-patches; +Cc: Ken Matsui
This patch implements a --num-commits (-n) flag for shorthand for
the range of hash~N..hash commits.
contrib/ChangeLog:
* gcc-changelog/git_check_commit.py: Implement --num-commits.
Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
---
contrib/gcc-changelog/git_check_commit.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/contrib/gcc-changelog/git_check_commit.py b/contrib/gcc-changelog/git_check_commit.py
index 8cca9f439a5..22e032e8b38 100755
--- a/contrib/gcc-changelog/git_check_commit.py
+++ b/contrib/gcc-changelog/git_check_commit.py
@@ -22,6 +22,12 @@ import argparse
from git_repository import parse_git_revisions
+def nonzero_uint(value):
+ ivalue = int(value)
+ if ivalue <= 0:
+ raise argparse.ArgumentTypeError('%s is not a non-zero positive integer' % value)
+ return ivalue
+
parser = argparse.ArgumentParser(description='Check git ChangeLog format '
'of a commit')
parser.add_argument('revisions', default='HEAD', nargs='?',
@@ -33,8 +39,17 @@ parser.add_argument('-p', '--print-changelog', action='store_true',
help='Print final changelog entires')
parser.add_argument('-v', '--verbose', action='store_true',
help='Print verbose information')
+parser.add_argument('-n', '--num-commits', type=nonzero_uint, default=1,
+ help='Number of commits to check (i.e. shorthand for '
+ 'hash~N..hash)')
args = parser.parse_args()
+if args.num_commits > 1:
+ if '..' in args.revisions:
+ print('ERR: --num-commits and range of revisions are mutually exclusive')
+ exit(1)
+ args.revisions = '{0}~{1}..{0}'.format(args.revisions, args.num_commits)
+
retval = 0
for git_commit in parse_git_revisions(args.git_path, args.revisions):
res = 'OK' if git_commit.success else 'FAILED'
--
2.44.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits
2024-02-28 21:09 [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits Ken Matsui
@ 2024-03-08 16:42 ` Patrick Palka
2024-03-14 7:57 ` Ken Matsui
0 siblings, 1 reply; 6+ messages in thread
From: Patrick Palka @ 2024-03-08 16:42 UTC (permalink / raw)
To: Ken Matsui; +Cc: gcc-patches
On Wed, 28 Feb 2024, Ken Matsui wrote:
> This patch implements a --num-commits (-n) flag for shorthand for
> the range of hash~N..hash commits.
>
> contrib/ChangeLog:
>
> * gcc-changelog/git_check_commit.py: Implement --num-commits.
LGTM
>
> Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
> ---
> contrib/gcc-changelog/git_check_commit.py | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/contrib/gcc-changelog/git_check_commit.py b/contrib/gcc-changelog/git_check_commit.py
> index 8cca9f439a5..22e032e8b38 100755
> --- a/contrib/gcc-changelog/git_check_commit.py
> +++ b/contrib/gcc-changelog/git_check_commit.py
> @@ -22,6 +22,12 @@ import argparse
>
> from git_repository import parse_git_revisions
>
> +def nonzero_uint(value):
> + ivalue = int(value)
> + if ivalue <= 0:
> + raise argparse.ArgumentTypeError('%s is not a non-zero positive integer' % value)
> + return ivalue
> +
> parser = argparse.ArgumentParser(description='Check git ChangeLog format '
> 'of a commit')
> parser.add_argument('revisions', default='HEAD', nargs='?',
> @@ -33,8 +39,17 @@ parser.add_argument('-p', '--print-changelog', action='store_true',
> help='Print final changelog entires')
> parser.add_argument('-v', '--verbose', action='store_true',
> help='Print verbose information')
> +parser.add_argument('-n', '--num-commits', type=nonzero_uint, default=1,
> + help='Number of commits to check (i.e. shorthand for '
> + 'hash~N..hash)')
> args = parser.parse_args()
>
> +if args.num_commits > 1:
> + if '..' in args.revisions:
> + print('ERR: --num-commits and range of revisions are mutually exclusive')
> + exit(1)
> + args.revisions = '{0}~{1}..{0}'.format(args.revisions, args.num_commits)
> +
> retval = 0
> for git_commit in parse_git_revisions(args.git_path, args.revisions):
> res = 'OK' if git_commit.success else 'FAILED'
> --
> 2.44.0
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits
2024-03-08 16:42 ` Patrick Palka
@ 2024-03-14 7:57 ` Ken Matsui
2024-05-06 13:25 ` Ken Matsui
0 siblings, 1 reply; 6+ messages in thread
From: Ken Matsui @ 2024-03-14 7:57 UTC (permalink / raw)
To: gcc-patches; +Cc: Ken Matsui, Jason Merrill, Jonathan Wakely
On Fri, Mar 8, 2024 at 8:42 AM Patrick Palka <ppalka@redhat.com> wrote:
>
> On Wed, 28 Feb 2024, Ken Matsui wrote:
>
> > This patch implements a --num-commits (-n) flag for shorthand for
> > the range of hash~N..hash commits.
Ping.
> >
> > contrib/ChangeLog:
> >
> > * gcc-changelog/git_check_commit.py: Implement --num-commits.
>
> LGTM
>
> >
> > Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
> > ---
> > contrib/gcc-changelog/git_check_commit.py | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/contrib/gcc-changelog/git_check_commit.py b/contrib/gcc-changelog/git_check_commit.py
> > index 8cca9f439a5..22e032e8b38 100755
> > --- a/contrib/gcc-changelog/git_check_commit.py
> > +++ b/contrib/gcc-changelog/git_check_commit.py
> > @@ -22,6 +22,12 @@ import argparse
> >
> > from git_repository import parse_git_revisions
> >
> > +def nonzero_uint(value):
> > + ivalue = int(value)
> > + if ivalue <= 0:
> > + raise argparse.ArgumentTypeError('%s is not a non-zero positive integer' % value)
> > + return ivalue
> > +
> > parser = argparse.ArgumentParser(description='Check git ChangeLog format '
> > 'of a commit')
> > parser.add_argument('revisions', default='HEAD', nargs='?',
> > @@ -33,8 +39,17 @@ parser.add_argument('-p', '--print-changelog', action='store_true',
> > help='Print final changelog entires')
> > parser.add_argument('-v', '--verbose', action='store_true',
> > help='Print verbose information')
> > +parser.add_argument('-n', '--num-commits', type=nonzero_uint, default=1,
> > + help='Number of commits to check (i.e. shorthand for '
> > + 'hash~N..hash)')
> > args = parser.parse_args()
> >
> > +if args.num_commits > 1:
> > + if '..' in args.revisions:
> > + print('ERR: --num-commits and range of revisions are mutually exclusive')
> > + exit(1)
> > + args.revisions = '{0}~{1}..{0}'.format(args.revisions, args.num_commits)
> > +
> > retval = 0
> > for git_commit in parse_git_revisions(args.git_path, args.revisions):
> > res = 'OK' if git_commit.success else 'FAILED'
> > --
> > 2.44.0
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits
2024-03-14 7:57 ` Ken Matsui
@ 2024-05-06 13:25 ` Ken Matsui
2024-05-06 16:20 ` Jason Merrill
0 siblings, 1 reply; 6+ messages in thread
From: Ken Matsui @ 2024-05-06 13:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Ken Matsui, Jason Merrill
On Thu, Mar 14, 2024 at 12:57 AM Ken Matsui <kmatsui@cs.washington.edu> wrote:
>
> On Fri, Mar 8, 2024 at 8:42 AM Patrick Palka <ppalka@redhat.com> wrote:
> >
> > On Wed, 28 Feb 2024, Ken Matsui wrote:
> >
> > > This patch implements a --num-commits (-n) flag for shorthand for
> > > the range of hash~N..hash commits.
>
> Ping.
Ping. Ok for trunk?
>
> > >
> > > contrib/ChangeLog:
> > >
> > > * gcc-changelog/git_check_commit.py: Implement --num-commits.
> >
> > LGTM
> >
> > >
> > > Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
> > > ---
> > > contrib/gcc-changelog/git_check_commit.py | 15 +++++++++++++++
> > > 1 file changed, 15 insertions(+)
> > >
> > > diff --git a/contrib/gcc-changelog/git_check_commit.py b/contrib/gcc-changelog/git_check_commit.py
> > > index 8cca9f439a5..22e032e8b38 100755
> > > --- a/contrib/gcc-changelog/git_check_commit.py
> > > +++ b/contrib/gcc-changelog/git_check_commit.py
> > > @@ -22,6 +22,12 @@ import argparse
> > >
> > > from git_repository import parse_git_revisions
> > >
> > > +def nonzero_uint(value):
> > > + ivalue = int(value)
> > > + if ivalue <= 0:
> > > + raise argparse.ArgumentTypeError('%s is not a non-zero positive integer' % value)
> > > + return ivalue
> > > +
> > > parser = argparse.ArgumentParser(description='Check git ChangeLog format '
> > > 'of a commit')
> > > parser.add_argument('revisions', default='HEAD', nargs='?',
> > > @@ -33,8 +39,17 @@ parser.add_argument('-p', '--print-changelog', action='store_true',
> > > help='Print final changelog entires')
> > > parser.add_argument('-v', '--verbose', action='store_true',
> > > help='Print verbose information')
> > > +parser.add_argument('-n', '--num-commits', type=nonzero_uint, default=1,
> > > + help='Number of commits to check (i.e. shorthand for '
> > > + 'hash~N..hash)')
> > > args = parser.parse_args()
> > >
> > > +if args.num_commits > 1:
> > > + if '..' in args.revisions:
> > > + print('ERR: --num-commits and range of revisions are mutually exclusive')
> > > + exit(1)
> > > + args.revisions = '{0}~{1}..{0}'.format(args.revisions, args.num_commits)
> > > +
> > > retval = 0
> > > for git_commit in parse_git_revisions(args.git_path, args.revisions):
> > > res = 'OK' if git_commit.success else 'FAILED'
> > > --
> > > 2.44.0
> > >
> > >
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits
2024-05-06 13:25 ` Ken Matsui
@ 2024-05-06 16:20 ` Jason Merrill
2024-05-06 16:26 ` Ken Matsui
0 siblings, 1 reply; 6+ messages in thread
From: Jason Merrill @ 2024-05-06 16:20 UTC (permalink / raw)
To: Ken Matsui, gcc-patches; +Cc: Ken Matsui
On 5/6/24 09:25, Ken Matsui wrote:
> On Thu, Mar 14, 2024 at 12:57 AM Ken Matsui <kmatsui@cs.washington.edu> wrote:
>>
>> On Fri, Mar 8, 2024 at 8:42 AM Patrick Palka <ppalka@redhat.com> wrote:
>>>
>>> On Wed, 28 Feb 2024, Ken Matsui wrote:
>>>
>>>> This patch implements a --num-commits (-n) flag for shorthand for
>>>> the range of hash~N..hash commits.
>>
>> Ping.
>
> Ping. Ok for trunk?
OK.
>>>>
>>>> contrib/ChangeLog:
>>>>
>>>> * gcc-changelog/git_check_commit.py: Implement --num-commits.
>>>
>>> LGTM
>>>
>>>>
>>>> Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
>>>> ---
>>>> contrib/gcc-changelog/git_check_commit.py | 15 +++++++++++++++
>>>> 1 file changed, 15 insertions(+)
>>>>
>>>> diff --git a/contrib/gcc-changelog/git_check_commit.py b/contrib/gcc-changelog/git_check_commit.py
>>>> index 8cca9f439a5..22e032e8b38 100755
>>>> --- a/contrib/gcc-changelog/git_check_commit.py
>>>> +++ b/contrib/gcc-changelog/git_check_commit.py
>>>> @@ -22,6 +22,12 @@ import argparse
>>>>
>>>> from git_repository import parse_git_revisions
>>>>
>>>> +def nonzero_uint(value):
>>>> + ivalue = int(value)
>>>> + if ivalue <= 0:
>>>> + raise argparse.ArgumentTypeError('%s is not a non-zero positive integer' % value)
>>>> + return ivalue
>>>> +
>>>> parser = argparse.ArgumentParser(description='Check git ChangeLog format '
>>>> 'of a commit')
>>>> parser.add_argument('revisions', default='HEAD', nargs='?',
>>>> @@ -33,8 +39,17 @@ parser.add_argument('-p', '--print-changelog', action='store_true',
>>>> help='Print final changelog entires')
>>>> parser.add_argument('-v', '--verbose', action='store_true',
>>>> help='Print verbose information')
>>>> +parser.add_argument('-n', '--num-commits', type=nonzero_uint, default=1,
>>>> + help='Number of commits to check (i.e. shorthand for '
>>>> + 'hash~N..hash)')
>>>> args = parser.parse_args()
>>>>
>>>> +if args.num_commits > 1:
>>>> + if '..' in args.revisions:
>>>> + print('ERR: --num-commits and range of revisions are mutually exclusive')
>>>> + exit(1)
>>>> + args.revisions = '{0}~{1}..{0}'.format(args.revisions, args.num_commits)
>>>> +
>>>> retval = 0
>>>> for git_commit in parse_git_revisions(args.git_path, args.revisions):
>>>> res = 'OK' if git_commit.success else 'FAILED'
>>>> --
>>>> 2.44.0
>>>>
>>>>
>>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits
2024-05-06 16:20 ` Jason Merrill
@ 2024-05-06 16:26 ` Ken Matsui
0 siblings, 0 replies; 6+ messages in thread
From: Ken Matsui @ 2024-05-06 16:26 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc-patches, Ken Matsui
On Mon, May 6, 2024 at 9:20 AM Jason Merrill <jason@redhat.com> wrote:
>
> On 5/6/24 09:25, Ken Matsui wrote:
> > On Thu, Mar 14, 2024 at 12:57 AM Ken Matsui <kmatsui@cs.washington.edu> wrote:
> >>
> >> On Fri, Mar 8, 2024 at 8:42 AM Patrick Palka <ppalka@redhat.com> wrote:
> >>>
> >>> On Wed, 28 Feb 2024, Ken Matsui wrote:
> >>>
> >>>> This patch implements a --num-commits (-n) flag for shorthand for
> >>>> the range of hash~N..hash commits.
> >>
> >> Ping.
> >
> > Ping. Ok for trunk?
>
> OK.
Thank you!
>
> >>>>
> >>>> contrib/ChangeLog:
> >>>>
> >>>> * gcc-changelog/git_check_commit.py: Implement --num-commits.
> >>>
> >>> LGTM
> >>>
> >>>>
> >>>> Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
> >>>> ---
> >>>> contrib/gcc-changelog/git_check_commit.py | 15 +++++++++++++++
> >>>> 1 file changed, 15 insertions(+)
> >>>>
> >>>> diff --git a/contrib/gcc-changelog/git_check_commit.py b/contrib/gcc-changelog/git_check_commit.py
> >>>> index 8cca9f439a5..22e032e8b38 100755
> >>>> --- a/contrib/gcc-changelog/git_check_commit.py
> >>>> +++ b/contrib/gcc-changelog/git_check_commit.py
> >>>> @@ -22,6 +22,12 @@ import argparse
> >>>>
> >>>> from git_repository import parse_git_revisions
> >>>>
> >>>> +def nonzero_uint(value):
> >>>> + ivalue = int(value)
> >>>> + if ivalue <= 0:
> >>>> + raise argparse.ArgumentTypeError('%s is not a non-zero positive integer' % value)
> >>>> + return ivalue
> >>>> +
> >>>> parser = argparse.ArgumentParser(description='Check git ChangeLog format '
> >>>> 'of a commit')
> >>>> parser.add_argument('revisions', default='HEAD', nargs='?',
> >>>> @@ -33,8 +39,17 @@ parser.add_argument('-p', '--print-changelog', action='store_true',
> >>>> help='Print final changelog entires')
> >>>> parser.add_argument('-v', '--verbose', action='store_true',
> >>>> help='Print verbose information')
> >>>> +parser.add_argument('-n', '--num-commits', type=nonzero_uint, default=1,
> >>>> + help='Number of commits to check (i.e. shorthand for '
> >>>> + 'hash~N..hash)')
> >>>> args = parser.parse_args()
> >>>>
> >>>> +if args.num_commits > 1:
> >>>> + if '..' in args.revisions:
> >>>> + print('ERR: --num-commits and range of revisions are mutually exclusive')
> >>>> + exit(1)
> >>>> + args.revisions = '{0}~{1}..{0}'.format(args.revisions, args.num_commits)
> >>>> +
> >>>> retval = 0
> >>>> for git_commit in parse_git_revisions(args.git_path, args.revisions):
> >>>> res = 'OK' if git_commit.success else 'FAILED'
> >>>> --
> >>>> 2.44.0
> >>>>
> >>>>
> >>>
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-05-06 16:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-28 21:09 [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits Ken Matsui
2024-03-08 16:42 ` Patrick Palka
2024-03-14 7:57 ` Ken Matsui
2024-05-06 13:25 ` Ken Matsui
2024-05-06 16:20 ` Jason Merrill
2024-05-06 16:26 ` Ken Matsui
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).