bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH 0/3] vcs-to-changelog fixes
@ 2020-01-16  7:19 Siddhesh Poyarekar
  2020-01-16  7:19 ` [PATCH 1/3] vcs-to-changelog: Drop python3 shebang from frontend_c.py Siddhesh Poyarekar
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Siddhesh Poyarekar @ 2020-01-16  7:19 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Siddhesh Poyarekar

Hi,

Following patches have a couple of fixes that were pending in my tree in
addition to a new option --quirks to allow specifying the quirks file.
This would allow me to only keep the quirks file in the glibc repo and
directly use vcs-to-changelog from gnulib without having to copy it into
glibc.

Thanks,
Siddhesh

Siddhesh Poyarekar (3):
  vcs-to-changelog: Drop python3 shebang from frontend_c.py
  vcs-to-changelog: Fix formatting of ChangeLog ouput
  vcs-to-changelog: Allow loading of custom quirks file

 build-aux/vcs_to_changelog.py   | 27 ++++++++++++++++++---------
 build-aux/vcstocl/frontend_c.py |  1 -
 build-aux/vcstocl/vcs_git.py    |  2 +-
 3 files changed, 19 insertions(+), 11 deletions(-)

-- 
2.24.1



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

* [PATCH 1/3] vcs-to-changelog: Drop python3 shebang from frontend_c.py
  2020-01-16  7:19 [PATCH 0/3] vcs-to-changelog fixes Siddhesh Poyarekar
@ 2020-01-16  7:19 ` Siddhesh Poyarekar
  2020-01-16  7:19 ` [PATCH 2/3] vcs-to-changelog: Fix formatting of ChangeLog ouput Siddhesh Poyarekar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Siddhesh Poyarekar @ 2020-01-16  7:19 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Siddhesh Poyarekar

frontend_c.py is not executed directly and hence does not need it.

	* build-aux/vcstocl/frontend_c.py: Remove shebang.
---
 build-aux/vcstocl/frontend_c.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/build-aux/vcstocl/frontend_c.py b/build-aux/vcstocl/frontend_c.py
index 4f6ef240a..81f37ffa4 100644
--- a/build-aux/vcstocl/frontend_c.py
+++ b/build-aux/vcstocl/frontend_c.py
@@ -1,4 +1,3 @@
-#!/usr/bin/python3
 # The C Parser.
 # Copyright (C) 2019-2020 Free Software Foundation, Inc.
 #
-- 
2.24.1



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

* [PATCH 2/3] vcs-to-changelog: Fix formatting of ChangeLog ouput
  2020-01-16  7:19 [PATCH 0/3] vcs-to-changelog fixes Siddhesh Poyarekar
  2020-01-16  7:19 ` [PATCH 1/3] vcs-to-changelog: Drop python3 shebang from frontend_c.py Siddhesh Poyarekar
@ 2020-01-16  7:19 ` Siddhesh Poyarekar
  2020-01-16  7:19 ` [PATCH 3/3] vcs-to-changelog: Allow loading of custom quirks file Siddhesh Poyarekar
  2020-01-16 20:32 ` [PATCH 0/3] vcs-to-changelog fixes Bruno Haible
  3 siblings, 0 replies; 6+ messages in thread
From: Siddhesh Poyarekar @ 2020-01-16  7:19 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Siddhesh Poyarekar

Add another newline when the number of files differing is too large.
This is typical for across-the-board changes such as copyright year
updates.

	* build-aux/vcstocl/vcs_git.py (list_changes): Add newline in
	print output.
---
 build-aux/vcstocl/vcs_git.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-aux/vcstocl/vcs_git.py b/build-aux/vcstocl/vcs_git.py
index 0b8099e0b..23ede3b5a 100644
--- a/build-aux/vcstocl/vcs_git.py
+++ b/build-aux/vcstocl/vcs_git.py
@@ -101,7 +101,7 @@ class GitRepo:
         # updates, copyright notice changes, etc.) and likely not interesting
         # enough to produce a detailed ChangeLog entry.
         if len(op) > 100:
-            print('\t* Suppressing diff as too many files differ.')
+            print('\t* Suppressing diff as too many files differ.\n')
             return
 
         # Each of these lines has a space separated format like so:
-- 
2.24.1



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

* [PATCH 3/3] vcs-to-changelog: Allow loading of custom quirks file
  2020-01-16  7:19 [PATCH 0/3] vcs-to-changelog fixes Siddhesh Poyarekar
  2020-01-16  7:19 ` [PATCH 1/3] vcs-to-changelog: Drop python3 shebang from frontend_c.py Siddhesh Poyarekar
  2020-01-16  7:19 ` [PATCH 2/3] vcs-to-changelog: Fix formatting of ChangeLog ouput Siddhesh Poyarekar
@ 2020-01-16  7:19 ` Siddhesh Poyarekar
  2020-01-16 20:32 ` [PATCH 0/3] vcs-to-changelog fixes Bruno Haible
  3 siblings, 0 replies; 6+ messages in thread
From: Siddhesh Poyarekar @ 2020-01-16  7:19 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Siddhesh Poyarekar

gnulib does not have a quirks file and if the scripts are not copied
over to the project tree, it may never find the quirks file in the
right place.  Add a flag to vcs_to_changelog.py to allow one to
specify the location of the quirks file instead.

	* build-aux/vcs_to_changelog.py: New commandline option -q.
---
 build-aux/vcs_to_changelog.py | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/build-aux/vcs_to_changelog.py b/build-aux/vcs_to_changelog.py
index d5931e4e9..bf4bc7cf6 100755
--- a/build-aux/vcs_to_changelog.py
+++ b/build-aux/vcs_to_changelog.py
@@ -78,17 +78,8 @@ class ProjectQuirks:
     # header file that is only assembly code, which breaks the C parser.
     IGNORE_LIST = ['ChangeLog']
 
-
-# Load quirks file.  We assume that the script is run from the top level source
-# directory.
 sys.path.append('/'.join([os.path.dirname(os.path.realpath(__file__)),
                 'vcstocl']))
-try:
-    from vcstocl_quirks import *
-    project_quirks = get_project_quirks(debug)
-except:
-    project_quirks = ProjectQuirks()
-
 
 def main(repo, frontends, refs):
     ''' ChangeLog Generator Entry Point.
@@ -107,6 +98,9 @@ if __name__ == '__main__':
     parser.add_argument('-d', '--debug', required=False, action='store_true',
                      help='Run the file parser debugger.')
 
+    parser.add_argument('-q', '--quirks', required=False, type=str,
+                     help='Load a quirks file.')
+
     args = parser.parse_args()
 
     debug.debug = args.debug
@@ -115,6 +109,21 @@ if __name__ == '__main__':
         debug.eprint('Two refs needed to get a ChangeLog.')
         sys.exit(os.EX_USAGE)
 
+    # Load quirks file.  We assume that the script is run from the top level source
+    # directory.
+    if args.quirks:
+        import importlib.util
+        spec = importlib.util.spec_from_file_location("vcstocl_quirks", args.quirks)
+        vcstocl_quirks = importlib.util.module_from_spec(spec)
+        spec.loader.exec_module(vcstocl_quirks)
+        project_quirks = vcstocl_quirks.get_project_quirks(debug)
+    else:
+        try:
+            from vcstocl_quirks import *
+            project_quirks = get_project_quirks(debug)
+        except:
+            project_quirks = ProjectQuirks()
+
     REPO = {'git': GitRepo(project_quirks.IGNORE_LIST, debug)}
 
     fe_c = frontend_c.Frontend(project_quirks, debug)
-- 
2.24.1



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

* Re: [PATCH 0/3] vcs-to-changelog fixes
  2020-01-16  7:19 [PATCH 0/3] vcs-to-changelog fixes Siddhesh Poyarekar
                   ` (2 preceding siblings ...)
  2020-01-16  7:19 ` [PATCH 3/3] vcs-to-changelog: Allow loading of custom quirks file Siddhesh Poyarekar
@ 2020-01-16 20:32 ` Bruno Haible
  2020-01-17  3:39   ` Siddhesh Poyarekar
  3 siblings, 1 reply; 6+ messages in thread
From: Bruno Haible @ 2020-01-16 20:32 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Siddhesh Poyarekar

Hi Siddhesh,

> Siddhesh Poyarekar (3):
>   vcs-to-changelog: Drop python3 shebang from frontend_c.py
>   vcs-to-changelog: Fix formatting of ChangeLog ouput
>   vcs-to-changelog: Allow loading of custom quirks file

Thanks. Applied.

For the first one, in gnulib, it's customary to reference, in the ChangeLog
entry, the report (mail or bug report) where which sollicited the change.
I added it.

Bruno



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

* Re: [PATCH 0/3] vcs-to-changelog fixes
  2020-01-16 20:32 ` [PATCH 0/3] vcs-to-changelog fixes Bruno Haible
@ 2020-01-17  3:39   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 6+ messages in thread
From: Siddhesh Poyarekar @ 2020-01-17  3:39 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib

On 17/01/20 2:02 am, Bruno Haible wrote:
> For the first one, in gnulib, it's customary to reference, in the ChangeLog
> entry, the report (mail or bug report) where which sollicited the change.
> I added it.

Got it, I'll keep that in mind.

Thanks,
Siddhesh


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

end of thread, other threads:[~2020-01-17  3:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16  7:19 [PATCH 0/3] vcs-to-changelog fixes Siddhesh Poyarekar
2020-01-16  7:19 ` [PATCH 1/3] vcs-to-changelog: Drop python3 shebang from frontend_c.py Siddhesh Poyarekar
2020-01-16  7:19 ` [PATCH 2/3] vcs-to-changelog: Fix formatting of ChangeLog ouput Siddhesh Poyarekar
2020-01-16  7:19 ` [PATCH 3/3] vcs-to-changelog: Allow loading of custom quirks file Siddhesh Poyarekar
2020-01-16 20:32 ` [PATCH 0/3] vcs-to-changelog fixes Bruno Haible
2020-01-17  3:39   ` Siddhesh Poyarekar

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