git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 0/2] diff-tree/diff-cache helper
Date: Tue, 26 Apr 2005 00:39:59 -0700	[thread overview]
Message-ID: <7vll76ouk0.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0504251832480.18901@ppc970.osdl.org> (Linus Torvalds's message of "Mon, 25 Apr 2005 18:38:05 -0700 (PDT)")

>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> Good, applied.

LT> This also makes me think that we should just make "show-diff" show the
LT> same format, at which point show-diff actually matches all the other
LT> tools, and it is likely to make show-diff more useful to boot.

Matching is good, ...

LT> Maybe rename the "show-diff" command to be "cache-diff", and if somebody
LT> wants the old "show-diff" thing, just have a script that does

LT> 	#!/bin/sh
LT> 	cache-diff | diff-tree-helper

LT> and nothing more.

Well, great minds do not think alike ;-) I was actually going in
quite the opposite way for the same goal of "matching".  My plan
was to rewrite the external diff interface once more to make it
more generic.  Then to add -p (patch) flag to diff-tree and
diff-cache, so that we do not need diff-tree-helper anymore.  My
ultimate motive for all of this is to make the core GIT useful
enough to render Cogito or any other wrapper layer more or less
irrelevant ;-).  Well type ^W a couple of times and rephrase
that to make things easier for the wrapper layer.

Jokes aside, I have updated the external diff interface and will
be sending you a patch in a separate message.  The existing
external diff interface had a horrible interface to the callers,
and it had a hardcoded knowledge of how to call diff and what
parameters to pass in which order, so the customization the end
user or the scripts could make was quite limited.  The updated
interface allows pretty much arbitrary formatting, so "git diff"
can put SHA1 instead of short-and-sweet 'a' or 'b' as directory
prefix in the patch output, for example.

When an environment variable GIT_EXTERNAL_DIFF exists, it names
a script that takes 7 parameters:

    name file1 sha1-1 mode1 file2 sha1-2 mode2

This is essentially the same idea you used for merge-cache.
Then the named command can use these information to generate and
format the diff any way it wants.  See how it interfaces using
the examples like this:

    GIT_EXTERNAL_DIFF=echo show-diff
    diff-cache $(cat .git/HEAD) | \
    GIT_EXTERNAL_DIFF=./jit-external-diff-script diff-tree-helper

The patch comes with a sample script, jit-external-diff-script,
but it is not much better than the built-in one; I do not expect
it to be used for anything other than starting point for wrapper
writers.

Without the environment variable, it uses a built-in
implementation that behaves exactly like the traditional
show-diff, and it can be customized via GIT_DIFF_CMD and
GIT_DIFF_OPTS as before.


  parent reply	other threads:[~2005-04-26  7:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1113400651.20848.135.camel@hades.cambridge.redhat.com>
2005-04-24  5:09 ` [GIT PATCH] Selective diff-tree Linus Torvalds
2005-04-24  6:25   ` David Woodhouse
2005-04-24 17:15     ` Linus Torvalds
2005-04-24  7:40   ` Junio C Hamano
2005-04-24 17:20     ` Linus Torvalds
2005-04-25  5:12   ` [PATCH 0/2] diff-tree/diff-cache helper Junio C Hamano
2005-04-25  5:15     ` [PATCH 1/2] Split external diff command interface to a separate file Junio C Hamano
2005-04-25  5:17     ` [PATCH 2/2] Introduce diff-tree-helper Junio C Hamano
2005-04-26  1:38     ` [PATCH 0/2] diff-tree/diff-cache helper Linus Torvalds
2005-04-26  2:08       ` Nicolas Pitre
2005-04-26  7:39       ` Junio C Hamano [this message]
2005-04-26  7:57         ` [PATCH] Diff-tree-helper take two Junio C Hamano
2005-04-26 22:27       ` [PATCH] Add -r flag to show-diff for diff-cache/diff-tree like output Junio C Hamano
2005-04-26 22:40         ` Linus Torvalds
2005-04-26 23:05           ` Junio C Hamano
2005-04-26 23:44             ` Linus Torvalds
2005-04-27  0:05               ` Junio C Hamano
2005-04-27  0:22                 ` Linus Torvalds
2005-04-26 23:45             ` [PATCH] diff-cache/tree compatible output for show-diff (take 2) Junio C Hamano
2005-04-27  0:20               ` Linus Torvalds
2005-04-27  0:29                 ` Linus Torvalds
     [not found]                   ` <Pine.LNX.4.58.0504261750030.18901@ppc970.osdl.org>
2005-04-27  1:09                     ` Linus Torvalds

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7vll76ouk0.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).