mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
pick-ui: show commit date
With our ff-only merge setup, the commit date ends up being when the
commit actually landed (as opposed to when it was first written).
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12289>
(cherry picked from commit 4128acdee3)
This commit is contained in:
parent
e2d700117b
commit
c64a3bc148
3 changed files with 10 additions and 2 deletions
|
|
@ -247,7 +247,7 @@
|
|||
"description": "pick-ui: show commit date",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -138,6 +138,14 @@ class Commit:
|
|||
c.resolution = Resolution(data['resolution'])
|
||||
return c
|
||||
|
||||
def date(self) -> str:
|
||||
# Show commit date, ie. when the commit actually landed
|
||||
# (as opposed to when it was first written)
|
||||
return subprocess.check_output(
|
||||
['git', 'show', '--no-patch', '--format=%cs', self.sha],
|
||||
stderr=subprocess.DEVNULL
|
||||
).decode("ascii").strip()
|
||||
|
||||
async def apply(self, ui: 'UI') -> typing.Tuple[bool, str]:
|
||||
# FIXME: This isn't really enough if we fail to cherry-pick because the
|
||||
# git tree will still be dirty
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class CommitWidget(urwid.Text):
|
|||
|
||||
def __init__(self, ui: 'UI', commit: 'core.Commit'):
|
||||
reason = commit.nomination_type.name.ljust(6)
|
||||
super().__init__(f'{reason} {commit.sha[:10]} {commit.description}')
|
||||
super().__init__(f'{commit.date()} {reason} {commit.sha[:10]} {commit.description}')
|
||||
self.ui = ui
|
||||
self.commit = commit
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue