public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: randy_dunlap <rdunlap@xenotime.net>
Cc: lkml <linux-kernel@vger.kernel.org>, njw@osdl.org
Subject: Re: [announce] 'patchview' ver. 003
Date: Fri, 22 Jul 2005 11:26:22 +0900	[thread overview]
Message-ID: <42E0594E.4060305@gmail.com> (raw)
In-Reply-To: <20050721133058.791773b8.rdunlap@xenotime.net>

randy_dunlap wrote:
> Hi,
> 
> [version 003]
> 
> 'patchview' merges a patch file and a source tree to a set of
> temporary modified files.  This enables better patch (re)viewing
> and more viewable context.  (hopefully)
> 
> 
> The patchview script is here:
>   http://www.xenotime.net/linux/scripts/patchview
> 
> 
> usage: patchview [-f] patchfile srctree {ver. 003}
>   -f : force tkdiff even if 'patch' has errors
>   -s : single tkdiff even if patchfile contains multiple files
> 
> 
> It uses (requires) lsdiff (from patchutils) and tkdiff.
> 
> patchutils:  http://cyberelk.net/tim/patchutils/
> tkdiff:      http://sourceforge.net/projects/tkdiff/
> 
> ---
> ~Randy
> 
> 
> Changes for ver. 003:
> - handle patch making empty .orig files (for new files)
>   with permission of 000

  Hi, Randy.

  Here's a small modification to make it work with mtkdiff (my hacked 
version of tkdiff which supports multiple files).  mtkdiff+patchview 
tarball is available at the following url.


http://home-tj.org/mtkdiff/files/patchview-mtkdiff.tar.gz


--- patchview.orig	2005-07-22 11:19:26.000000000 +0900
+++ patchview/patchview	2005-07-22 11:21:01.000000000 +0900
@@ -5,7 +5,7 @@
  # uses patchutils (lsdiff) and tkdiff

  PROG=patchview
-VERSION=003
+VERSION=004

  # usage: help message and exit
  function usage()
@@ -40,7 +40,12 @@

  force=0
  single=0
+mtkdiff=0
  VIEWER="tkdiff"
+if [ -x "`which mtkdiff`" ]; then
+	VIEWER="mtkdiff"
+	mtkdiff=1
+fi
  # or maybe "sh -c colordiff" would work

  while [ -n "$1" ]
@@ -117,15 +122,29 @@
  	exit 1
  fi

-for pf in $pfiles ; do
-	$VIEWER $WORKDIR/$pf.orig $WORKDIR/$pf &
-	if [ ${single} -eq 1 ]; then
-		wait # for viewer to exit
-	fi
-done
+if [ $mtkdiff -ne 0 ]; then
+	i=0
+	argv[i++]="-gdesc"
+	argv[i++]=`diffstat $patchfile`
+	for pf in $pfiles ; do
+		argv[i++]="-fname"
+		argv[i++]="$pf"
+		argv[i++]="$WORKDIR/$pf.orig"
+		argv[i++]="$WORKDIR/$pf"
+	done

-if [ ${single} -eq 0 ]; then
-	wait # for all viewers to exit
+	mtkdiff "${argv[@]}"
+else
+	for pf in $pfiles ; do
+		$VIEWER $WORKDIR/$pf.orig $WORKDIR/$pf &
+		if [ ${single} -eq 1 ]; then
+			wait # for viewer to exit
+		fi
+	done
+
+	if [ ${single} -eq 0 ]; then
+		wait # for all viewers to exit
+	fi
  fi

  rm -rf $WORKDIR


      reply	other threads:[~2005-07-22  2:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-21 20:30 [announce] 'patchview' ver. 003 randy_dunlap
2005-07-22  2:26 ` Tejun Heo [this message]

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=42E0594E.4060305@gmail.com \
    --to=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=njw@osdl.org \
    --cc=rdunlap@xenotime.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox