Add 'dim cite' subcommand to cite the supplied committish in format 'sha1 ("commit subject")'. Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> --- dim | 12 ++++++++++-- dim.rst | 6 +++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dim b/dim index 2adbad375167..2b35e0ef69c9 100755 --- a/dim +++ b/dim @@ -1169,13 +1169,21 @@ function dim_tc fi } +function dim_cite +{ + local sha1=$1 + cd $DIM_PREFIX/$DIM_DRM_INTEL + + git log -1 $sha1 "--pretty=format:%H (\"%s\")%n" | \ + sed -e 's/\([0-f]\{12\}\)[0-f]*/\1/' +} + function dim_fixes { cd $DIM_PREFIX/$DIM_DRM_INTEL local sha1=$1 - git log -1 $sha1 "--pretty=format:Fixes: %H (\"%s\")%n" | \ - sed -e 's/\([0-f]\{12\}\)[0-f]*/\1/' + echo "Fixes: $(dim_cite $sha1)" local tag=$(git tag --contains $1 | grep ^v | sort -V | head -n 1) if [[ -n "$tag" ]]; then diff --git a/dim.rst b/dim.rst index 4a011f44b3ee..0b436f212539 100644 --- a/dim.rst +++ b/dim.rst @@ -177,9 +177,13 @@ tc *commit-ish* Print the oldest Linux kernel release or -rc tag that contains the supplied *commit-ish*, or, if none do, print the upstream branches that contain it. +cite *commit-ish* +----------------- +Cite the supplied *commit-ish* in format 'sha1 ("commit subject")'. + fixes *commit-ish* ------------------ -Print the Fixes: line for the supplied *commit-ish* in the linux kernel +Print the Fixes: and Cc: lines for the supplied *commit-ish* in the linux kernel CodingStyle approved format. check-patch|cp [*commit-ish* [.. *commit-ish*]] -- 2.1.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx