Commit Graph

9 Commits

Author SHA1 Message Date
Junio C Hamano
0a5a9ea433 Update git-diff-script.
This uses the fixed rev-parse to allow passing diff options to the
underlying diff command.  For example:

    $ git diff -r HEAD

shows the output in raw-diff format, and

    $ git diff -p -R HEAD | git apply

generates a patch to go back from your working tree to HEAD commit
(i.e. an expensive way to say "git checkout -f HEAD").

At the same time, it accidentally removes the use of shell arrays.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-23 13:18:00 -07:00
Junio C Hamano
792fe559d0 Fix "git-diff-script A B"
When "git-diff-script A..B" notation was introduced, it ended up breaking
the traditional two revisions notation.

[jc: there are other issues with the current "git diff" I would like to
 address, but they would be left to later rounds.  For example, -M and -p flags
 should not be hardcoded default, and it shouldn't be too hard to rewrite
 the script without using shell arrays.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-22 18:32:38 -07:00
Linus Torvalds
d288a70030 [PATCH] Make "git diff" work inside relative subdirectories
We always show the diff as an absolute path, but pathnames to diff are
taken relative to the current working directory (and if no pathnames are
given, the default ends up being all of the current working directory).

Note that "../xyz" also works, so you can do

	cd linux/drivers/char
	git diff ../block

and it will generate a diff of the linux/drivers/block changes.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-16 18:47:22 -07:00
Linus Torvalds
d1918a7285 Make "git diff" use git-sh-setup-script too..
Give a sane error rather than just silently claiming no diffs when
you're not at the top-level directory.
2005-07-14 09:29:35 -07:00
Linus Torvalds
9e9824ba0e Use the new git-rev-parse "--[no-]flags" in "git diff".
This allows you to do

	git diff v2.6.12..v2.6.13-rc1 drivers/pcmcia

to see the diff between v2.6.12 and v2.6.13-rc1 as limited by the
filename argument.
2005-07-06 10:09:58 -07:00
Linus Torvalds
753fd78458 Use "-M" instead of "-C" for "git diff" and "git status"
The "C" in "-C" may stand for "Cool", but it's also pretty slow, since
right now it leaves all unmodified files to be tested even if there are
no new files at all.  That just ends up being unacceptably slow for big
projects, especially if it's not all in the cache.
2005-06-17 15:34:19 -07:00
Linus Torvalds
aeac668125 Don't use -C in "git diff"
Right now it confuses at least git-diff-files, since it leaves
all the files (whether changed or not) in the diff queue.
2005-06-17 12:46:38 -07:00
Linus Torvalds
40d8cfe411 Trivial git script fixups
Fix permissions, and add trivial "reset" and "add" scripts.

The "reset" script just resets the index back to head, while the "add"
script is just a crutch for people used to do "cvs add".
2005-06-14 18:56:05 -07:00
Linus Torvalds
940c1bb018 Add "git diff" script
It's a simple helper that depending on the arguments will either
use git-diff-files, git-diff-cache or git-diff-tree.
2005-06-13 15:09:34 -07:00