Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4431c94

Browse files
committed
Preserve information on use of git-external-diff
Now that the Working with git wiki page no longer suggests producingcontext diffs, we should preserve the information on how to usegit-external-diff for those people who want to view context formatdiffs. The most obvious place is in the script itself, so that's what'sdone here.
1 parent0c7e6b7 commit4431c94

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

‎src/tools/git-external-diff

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,41 @@
77
# path old-file old-hash old-mode new-file new-hash new-mode
88
# 'path' is the git-tree-relative path of the file being diff'ed
99

10+
=comment
11+
12+
This info is copied from the old wiki page on Working with git:
13+
14+
Context diffs with Git
15+
16+
Copy git-external-diff into libexec/git-core/ of your git installation
17+
and configure git to use that wrapper with:
18+
19+
git config [--global] diff.external git-external-diff
20+
21+
--global makes the configuration globalfor your user - otherwise it is
22+
just configuredfor the current repository.
23+
24+
For everycommand which displays diffsin some way you can use the
25+
parameter"--[no-]-ext-diff" toenable respectively disable using the
26+
external diff command.
27+
28+
For the git diffcommand --ext-diff is enabled by default -for any
29+
othercommand like git log -p or git format-patch it is not!
30+
31+
This method should work on all platforms supported by git.
32+
33+
If youdo not want to configure the external wrapper permanently or you
34+
want to overwrite it you can also invoke git like:
35+
36+
export GIT_EXTERNAL_DIFF=git-external-diff
37+
git diff --[no-]ext-diff
38+
39+
Alternatively, configure a gitaliasin~/.gitconfig or .git/config:
40+
41+
[alias]
42+
cdiff =!GIT_EXTERNAL_DIFF=git-context-diff git diff
43+
=cut
44+
1045
old_hash="$3"
1146
new_hash=$(git hash-object"$5")
1247

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp