diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-03-11 00:47:49 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-03-11 00:47:49 +0100 |
commit | 7f7da6c240f2e0284ff201975844673f2ef070c7 (patch) | |
tree | 612ae67f3bf3a7f2ada0b56bbac0ba4a8ef4783d /contrib | |
parent | a1bd74ba1df9efa557d6b4d873f39c36d59ed72c (diff) | |
parent | b59e9de990a17bfd5fa7252b76339c35bff7f2e8 (diff) | |
download | gcc-7f7da6c240f2e0284ff201975844673f2ef070c7.zip gcc-7f7da6c240f2e0284ff201975844673f2ef070c7.tar.gz gcc-7f7da6c240f2e0284ff201975844673f2ef070c7.tar.bz2 |
Merge commit 'af91934c2f6b8efc67d625c99068b4761ae5edd0^' into HEAD
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ChangeLog | 41 | ||||
-rwxr-xr-x | contrib/gcc-changelog/git_commit.py | 20 | ||||
-rwxr-xr-x | contrib/gcc-changelog/git_email.py | 3 | ||||
-rwxr-xr-x | contrib/gcc-git-customization.sh | 6 |
4 files changed, 62 insertions, 8 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 0e2cbec..403a095 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,44 @@ +2023-09-07 Tobias Burnus <tobias@codesourcery.com> + + * gcc-changelog/git_commit.py (GitCommit.__init__, + to_changelog_entries): Fix lost wording fix. + +2023-09-07 Tobias Burnus <tobias@codesourcery.com> + + * gcc-changelog/git_commit.py (GitCommit.__init__): + Handle commit_to_info_hook = None; otherwise, if None, + regard it as error. + (to_changelog_entries): Handle commit_to_info_hook = None; + if info is None, create a warning for it. + * gcc-changelog/git_email.py (GitEmail.__init__): + call super() with commit_to_info_hook=None instead + of a lambda function. + +2023-09-07 Tobias Burnus <tobias@codesourcery.com> + + Revert: + 2023-09-07 Tobias Burnus <tobias@codesourcery.com> + + * gcc-changelog/git_commit.py (GitCommit.__init__): + Handle commit_to_info_hook = None; otherwise, if None, + regard it as error. + (to_changelog_entries): Handle commit_to_info_hook = None; + if info is None, create a warning for it. + * gcc-changelog/git_email.py (GitEmail.__init__): + call super() with commit_to_info_hook=None instead + of a lamda function. + +2023-09-07 Tobias Burnus <tobias@codesourcery.com> + + * gcc-changelog/git_commit.py (GitCommit.__init__): + Handle commit_to_info_hook = None; otherwise, if None, + regard it as error. + (to_changelog_entries): Handle commit_to_info_hook = None; + if info is None, create a warning for it. + * gcc-changelog/git_email.py (GitEmail.__init__): + call super() with commit_to_info_hook=None instead + of a lamda function. + 2023-09-04 Marc Poulhiès <dkm@kataplop.net> * mklog.py: Leave SOB lines after changelog. diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index a15cab4..4e601fa 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -330,11 +330,15 @@ class GitCommit: self.revert_commit = m.group('hash') break if self.revert_commit: + # The following happens for get_email.py: + if not self.commit_to_info_hook: + self.warnings.append(f"Invoked script can not obtain info about " + f"reverted commits such as '{self.revert_commit}'") + return self.info = self.commit_to_info_hook(self.revert_commit) - - # The following happens for get_email.py: - if not self.info: - return + if not self.info: + self.errors.append(Error('Cannot find to-be-reverted commit', self.revert_commit)) + return self.check_commit_email() @@ -797,12 +801,18 @@ class GitCommit: orig_date = self.original_info.date current_timestamp = orig_date.strftime(DATE_FORMAT) elif self.cherry_pick_commit: - info = self.commit_to_info_hook(self.cherry_pick_commit) + info = (self.commit_to_info_hook + and self.commit_to_info_hook(self.cherry_pick_commit)) # it can happen that it is a cherry-pick for a different # repository if info: timestamp = info.date.strftime(DATE_FORMAT) else: + if self.commit_to_info_hook: + self.warnings.append(f"Cherry-picked commit not found: '{self.cherry_pick_commit}'") + else: + self.warnings.append(f"Invoked script can not obtain info about " + f"cherry-picked commits such as '{self.revert_commit}'") timestamp = current_timestamp elif not timestamp or use_commit_ts: timestamp = current_timestamp diff --git a/contrib/gcc-changelog/git_email.py b/contrib/gcc-changelog/git_email.py index 49f41f2..93808df 100755 --- a/contrib/gcc-changelog/git_email.py +++ b/contrib/gcc-changelog/git_email.py @@ -89,8 +89,7 @@ class GitEmail(GitCommit): t = 'M' modified_files.append((target if t != 'D' else source, t)) git_info = GitInfo(None, date, author, message, modified_files) - super().__init__(git_info, - commit_to_info_hook=lambda x: None) + super().__init__(git_info, commit_to_info_hook=None) def show_help(): diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh index 914d868..2e173e8 100755 --- a/contrib/gcc-git-customization.sh +++ b/contrib/gcc-git-customization.sh @@ -46,7 +46,11 @@ set_email=$(git config --get "user.email") if [ "x$set_user" = "x" ] then # Try to guess the user's name by looking it up in the password file - new_user=$(getent passwd $(whoami) | awk -F: '{ print $5 }') + if type getent >/dev/null 2>&1; then + new_user=$(getent passwd $(whoami) | awk -F: '{ print $5 }') + elif [ $(uname -s) = Darwin ]; then + new_user=$(id -F 2>/dev/null) + fi if [ "x$new_user" = "x" ] then new_user="(no default)" |