From patchwork Fri Sep 20 16:50:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 34614 Received: (qmail 89280 invoked by alias); 20 Sep 2019 16:51:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 89272 invoked by uid 89); 20 Sep 2019 16:51:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*RU:sk:smtpout, HX-Spam-Relays-External:sk:smtpout, neat, HX-Envelope-From:sk:gabriel X-HELO: smtpout1.mo803.mail-out.ovh.net Date: Fri, 20 Sep 2019 13:50:44 -0300 From: "Gabriel F. T. Gomes" To: Siddhesh Poyarekar CC: , , Subject: Re: [PATCH] Script to generate ChangeLog-like output from git log Message-ID: <20190920135044.2b3939e1@tereshkova> In-Reply-To: <20190918001341.21967-1-siddhesh@gotplt.org> References: <20190918001341.21967-1-siddhesh@gotplt.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 247697981040086716 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvddvgddutdehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Hi, Siddhesh, Thank you so much for doing this. The patch looks good to me, although I think it would be a little bit better to use the commit date, instead of the author date, because it would make the order of the commits look a bit more sane and it would more closely resemble what we have today. To achieve this, you could apply the following patch on top of yours. If you think that's nice, you have my OK to commit it with the change. If you would prefer to have the Author Date in the ChangeLog output, I'm also OK with it! Thanks again! Also, 'git am' warned that misc_util.py adds a new blank line at EOF. --- Here's the diff I mentioned above: --- Thanks! On Tue, 17 Sep 2019, Siddhesh Poyarekar wrote: >The C parser currently can identify macro definitions and scopes and >all global and static declarations and definitions. It cannot parse >(and compare) changes inside functions yet, it could be a future >enhancement if the need for it arises. This is the fast-forward block I commented below. It looks pretty cool to me as is, actually. >Testing >------- > >The script has been tested with the glibc repository up to glibc-2.30 >and also in the past with emacs. While it would be ideal to have >something like this in a repository like gnulib, that should not be a >bottleneck for glibc to start using this, so this patch proposes to >add these scripts into glibc. I checked on a Fedora 30 x86_64 machine, with and without the change to CommitDate, and the results look good to me. >And here is (hopefully!) one of the last ChangeLog entries we'd have >to write for glibc: :) >+ # Consume everything up to the ending brace of the function. >+ (cur, loc) = self.fast_forward_scope(cur, op, loc) Neat! I run this with extra printfs in the code, and notice that the whole function implementation goes into the 'contents' field, which can later be compared by 'compare_trees'. >--- /dev/null >+++ b/scripts/vcs_to_changelog/misc_util.py > > [...] > >+ DebugUtil.eprint('Failed to decode: %s' % string) >+ New blank line at EOF, as warned by git am. diff --git a/scripts/vcs_to_changelog/vcs_git.py b/scripts/vcs_to_changelog/vcs_git.py index f17846c385..b5da93f804 100644 --- a/scripts/vcs_to_changelog/vcs_git.py +++ b/scripts/vcs_to_changelog/vcs_git.py @@ -48,7 +48,7 @@ class GitRepo: calling into helper functions as necessary. ''' - op = self.exec_git_cmd(['show', '--date=short', '--raw', commit]) + op = self.exec_git_cmd(['show', '--pretty=fuller', '--date=short', '--raw', commit]) authors = [] date = '' merge = False @@ -64,8 +64,8 @@ class GitRepo: author = l.split(':')[1] author = re.sub(r'([^ ]*)\s*(<.*)', r'\1 \2', author.strip()) authors.append(author) - elif l.find('Date:') == 0: - date = l[5:].strip() + elif l.find('CommitDate:') == 0: + date = l[11:].strip() elif l.find('Merge:') == 0: merge = True elif not subject and date: