From: Bruno Haible <bruno@clisp.org>
To: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: git: how to produce context diffs?
Date: Mon, 27 Nov 2006 15:16:30 +0100 [thread overview]
Message-ID: <200611271516.30425.bruno@clisp.org> (raw)
Hi,
Is this a bug in git-diff? The git-diff-files.html says:
" When the environment variable GIT_EXTERNAL_DIFF is not set ...
For example, if you prefer context diff:
GIT_DIFF_OPTS=-c git-diff-index -p HEAD "
This doesn't work for me with git-1.4.4:
$ unset GIT_EXTERNAL_DIFF
$ export GIT_DIFF_OPTS=-c
$ git-diff-index -p HEAD
diff --git a/configure.ac b/configure.ac
index 74901dc..d222ded 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(hello, 2.1.1, bug-gnu-hello@gnu.org)
+AC_INIT(hello, 2.1.2, bug-gnu-hello@gnu.org)
AC_CONFIG_SRCDIR([src/hello.c])
AC_PREREQ(2.52)
Expected output:
$ git-diff-index -p HEAD
index 74901dc..d222ded 100644
diff --git a/configure.ac b/configure.ac
*** a/configure.ac
--- b/configure.ac
***************
*** 1,5 ****
dnl Process this file with autoconf to produce a configure script.
! AC_INIT(hello, 2.1.1, bug-gnu-hello@gnu.org)
AC_CONFIG_SRCDIR([src/hello.c])
AC_PREREQ(2.52)
--- 1,5 ----
dnl Process this file with autoconf to produce a configure script.
! AC_INIT(hello, 2.1.2, bug-gnu-hello@gnu.org)
AC_CONFIG_SRCDIR([src/hello.c])
AC_PREREQ(2.52)
(Really, while I find -u diffs fine for tiny changes, I find them unreadable
for rewrites of larger blocks, and cannot live without -c for these.)
When I look at diff.c around
const char *diffopts = getenv("GIT_DIFF_OPTS");
it appears that only unified diffs are supported??
next reply other threads:[~2006-11-27 14:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-27 14:16 Bruno Haible [this message]
2006-11-27 14:27 ` git: how to produce context diffs? Jakub Narebski
2006-11-27 15:19 ` Sean
2006-11-27 16:05 ` Jakub Narebski
2006-11-27 17:06 ` Sean
2006-11-27 15:38 ` Sean
2006-11-27 18:33 ` Thomas Kolejka
2006-11-27 19:18 ` Junio C Hamano
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=200611271516.30425.bruno@clisp.org \
--to=bruno@clisp.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.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.
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).