All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: dim-tools@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH] dim: Add range-diff convenience wrapper
Date: Thu,  4 Oct 2018 12:45:51 +0200	[thread overview]
Message-ID: <20181004104551.5256-1-daniel.vetter@ffwll.ch> (raw)

range-diff is awesome, but the interface is a bit silly. Add a bunch
of shortcuts, inspired by what git diff does.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 dim     | 13 +++++++++++++
 dim.rst |  8 ++++++++
 2 files changed, 21 insertions(+)

diff --git a/dim b/dim
index 12c80e2051b6..c4663aca6b5c 100755
--- a/dim
+++ b/dim
@@ -475,6 +475,19 @@ function dim_retip
 	git rebase --onto $new_upstream $upstream $branch "$@"
 }
 
+function dim_range_diff
+{
+	local branch
+
+	branch=${1:-@\{1\}}
+
+	if [[ $branch != "" && $(git rev-parse $branch | wc -l) -eq 1 ]] ; then
+		git range-diff $branch...HEAD
+	else
+		git range-diff "$@"
+	fi
+}
+
 # update for-linux-next and for-linux-next-fixes branches
 function update_linux_next # branch next next-fixes fixes
 {
diff --git a/dim.rst b/dim.rst
index b149fa39445e..9e41133aeb8d 100644
--- a/dim.rst
+++ b/dim.rst
@@ -95,6 +95,14 @@ retip [*branch*] [*git-rebase option* ...]
 Rebase the given local branch, current branch by default, onto drm-tip. Options
 after the branch will be passed to **git-rebase**.
 
+range-diff [ *commit-ish* | *git-range-diff options* ]
+------------------------------------------------------
+
+Convenience wrapper around the git range-diff command which automatically
+compares against HEAD if you only specify a commit-ish. In all other cases
+forwards to git range-diff. Defaults to @{1}, which is very useful for reviewing
+rebases.
+
 COMMANDS FOR COMMITTERS AND MAINTAINERS
 =======================================
 
-- 
2.19.0.rc2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2018-10-04 10:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 10:45 Daniel Vetter [this message]
2018-10-04 11:00 ` [PATCH] dim: Add range-diff convenience wrapper Daniel Vetter
2018-10-05 18:43   ` Lucas De Marchi
2018-10-05 19:06     ` [Intel-gfx] " Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181004104551.5256-1-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dim-tools@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.