From 1b3a667461c7b85068d38eb50fa60529959855fb Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Thu, 13 Jul 2006 22:22:13 +0200 Subject: [PATCH 01/17] Wrap long lines in docstrings in contrib/emacs/git.el Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- contrib/emacs/git.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el index ebd00ef9c4..83a845dd94 100644 --- a/contrib/emacs/git.el +++ b/contrib/emacs/git.el @@ -59,14 +59,16 @@ (defcustom git-committer-name nil "User name to use for commits. -The default is to fall back to the repository config, then to `add-log-full-name' and then to `user-full-name'." +The default is to fall back to the repository config, +then to `add-log-full-name' and then to `user-full-name'." :group 'git :type '(choice (const :tag "Default" nil) (string :tag "Name"))) (defcustom git-committer-email nil "Email address to use for commits. -The default is to fall back to the git repository config, then to `add-log-mailing-address' and then to `user-mail-address'." +The default is to fall back to the git repository config, +then to `add-log-mailing-address' and then to `user-mail-address'." :group 'git :type '(choice (const :tag "Default" nil) (string :tag "Email"))) @@ -86,6 +88,7 @@ The default is to fall back to the git repository config, then to `add-log-maili :group 'git :type 'string) + (defface git-status-face '((((class color) (background light)) (:foreground "purple"))) "Git mode face used to highlight added and modified files." @@ -149,7 +152,8 @@ The default is to fall back to the git repository config, then to `add-log-maili (apply #'call-process "git" nil buffer nil args))) (defun git-call-process-env-string (env &rest args) - "Wrapper for call-process that sets environment strings, and returns the process output as a string." + "Wrapper for call-process that sets environment strings, +and returns the process output as a string." (with-temp-buffer (and (eq 0 (apply #' git-call-process-env t env args)) (buffer-string)))) From 5716e794bf12ad9740da41d06c94e2771fe9e0ee Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Thu, 13 Jul 2006 22:22:14 +0200 Subject: [PATCH 02/17] Display help for Git mode after pressing `h' or `?' in *git-status* Add bindings for "h" and "?" in git-status-mode to display help about the mode, including keymap via (describe-function 'git-status-mode), like in PCL-CVS. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- contrib/emacs/git.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el index 83a845dd94..34c995046d 100644 --- a/contrib/emacs/git.el +++ b/contrib/emacs/git.el @@ -943,6 +943,8 @@ and returns the process output as a string." (let ((map (make-keymap)) (diff-map (make-sparse-keymap))) (suppress-keymap map) + (define-key map "?" 'git-help) + (define-key map "h" 'git-help) (define-key map " " 'git-next-file) (define-key map "a" 'git-add-file) (define-key map "c" 'git-commit-file) @@ -1012,5 +1014,10 @@ Commands: (goto-char (point-min))) (message "%s is not a git working tree." dir))) +(defun git-help () + "Display help for Git mode." + (interactive) + (describe-function 'git-status-mode)) + (provide 'git) ;;; git.el ends here From a40d384caca008c0334a35e9ac298f2eeb5decd2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 13 Jul 2006 19:51:12 -0700 Subject: [PATCH 03/17] t4013 diff format tests update This changes one test commit in the sequence to have more than one lines of commit log. A few output formats (--pretty=email aka format-patch and --pretty=oneline) need to behave differently on single and multi-line log, and this change will help catching breakages. Signed-off-by: Junio C Hamano --- t/t4013-diff-various.sh | 5 ++++- ...f-tree_--cc_--patch-with-stat_--summary_master | 2 +- .../diff.diff-tree_--cc_--patch-with-stat_master | 2 +- .../diff.diff-tree_--cc_--stat_--summary_master | 2 +- t/t4013/diff.diff-tree_--cc_--stat_master | 2 +- t/t4013/diff.diff-tree_--cc_master | 2 +- t/t4013/diff.diff-tree_-c_--abbrev_master | 2 +- t/t4013/diff.diff-tree_-c_--stat_--summary_master | 2 +- t/t4013/diff.diff-tree_-c_--stat_master | 2 +- t/t4013/diff.diff-tree_-c_master | 2 +- t/t4013/diff.diff-tree_-p_-m_master | 4 ++-- ...format-patch_--attach_--stdout_initial..master | 15 +++++++++------ ...ormat-patch_--attach_--stdout_initial..master^ | 15 +++++++++------ .../diff.format-patch_--stdout_initial..master | 6 ++++-- .../diff.format-patch_--stdout_initial..master^ | 6 ++++-- ...log_--patch-with-stat_--summary_master_--_dir_ | 10 ++++++---- t/t4013/diff.log_--patch-with-stat_master | 10 ++++++---- t/t4013/diff.log_--patch-with-stat_master_--_dir_ | 10 ++++++---- ...--root_--cc_--patch-with-stat_--summary_master | 10 ++++++---- ....log_--root_--patch-with-stat_--summary_master | 10 ++++++---- t/t4013/diff.log_--root_--patch-with-stat_master | 10 ++++++---- ...g_--root_-c_--patch-with-stat_--summary_master | 10 ++++++---- t/t4013/diff.log_--root_-p_master | 10 ++++++---- t/t4013/diff.log_--root_master | 10 ++++++---- t/t4013/diff.log_-SF_-p_master | 2 +- t/t4013/diff.log_-SF_master | 2 +- t/t4013/diff.log_-p_master | 10 ++++++---- t/t4013/diff.log_master | 10 ++++++---- t/t4013/diff.show_master | 4 ++-- ...ged_--patch-with-stat_--summary_master_--_dir_ | 6 ++++-- t/t4013/diff.whatchanged_--patch-with-stat_master | 6 ++++-- ...f.whatchanged_--patch-with-stat_master_--_dir_ | 6 ++++-- ...--root_--cc_--patch-with-stat_--summary_master | 10 ++++++---- ...nged_--root_--patch-with-stat_--summary_master | 6 ++++-- ...ff.whatchanged_--root_--patch-with-stat_master | 6 ++++-- ...d_--root_-c_--patch-with-stat_--summary_master | 10 ++++++---- t/t4013/diff.whatchanged_--root_-p_master | 6 ++++-- t/t4013/diff.whatchanged_--root_master | 6 ++++-- t/t4013/diff.whatchanged_-SF_-p_master | 2 +- t/t4013/diff.whatchanged_-SF_master | 2 +- t/t4013/diff.whatchanged_-p_master | 6 ++++-- t/t4013/diff.whatchanged_master | 6 ++++-- 42 files changed, 161 insertions(+), 104 deletions(-) diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 36658fb17d..b24c829f0f 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -7,6 +7,9 @@ test_description='Various diff formatting options' . ./test-lib.sh +LF=' +' + test_expect_success setup ' GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" && @@ -31,7 +34,7 @@ test_expect_success setup ' for i in C D; do echo $i; done >>dir/sub && rm -f file2 && git update-index --remove file0 file2 dir/sub && - git commit -m Second && + git commit -m "Second${LF}${LF}This is the second commit." && GIT_AUTHOR_DATE="2006-06-26 00:02:00 +0000" && GIT_COMMITTER_DATE="2006-06-26 00:02:00 +0000" && diff --git a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master index 0ac9800913..3a9f78a09d 100644 --- a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master +++ b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_--summary_master @@ -1,5 +1,5 @@ $ git diff-tree --cc --patch-with-stat --summary master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 dir/sub | 2 ++ file0 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master index f6ecf76366..49f23b9215 100644 --- a/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master +++ b/t/t4013/diff.diff-tree_--cc_--patch-with-stat_master @@ -1,5 +1,5 @@ $ git diff-tree --cc --patch-with-stat master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 dir/sub | 2 ++ file0 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.diff-tree_--cc_--stat_--summary_master b/t/t4013/diff.diff-tree_--cc_--stat_--summary_master index 712ffd2d89..cc6eb3b3d5 100644 --- a/t/t4013/diff.diff-tree_--cc_--stat_--summary_master +++ b/t/t4013/diff.diff-tree_--cc_--stat_--summary_master @@ -1,5 +1,5 @@ $ git diff-tree --cc --stat --summary master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 dir/sub | 2 ++ file0 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.diff-tree_--cc_--stat_master b/t/t4013/diff.diff-tree_--cc_--stat_master index 8d5bdc985a..fae7f33255 100644 --- a/t/t4013/diff.diff-tree_--cc_--stat_master +++ b/t/t4013/diff.diff-tree_--cc_--stat_master @@ -1,5 +1,5 @@ $ git diff-tree --cc --stat master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 dir/sub | 2 ++ file0 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.diff-tree_--cc_master b/t/t4013/diff.diff-tree_--cc_master index e57d943bdc..5ecb4e14ae 100644 --- a/t/t4013/diff.diff-tree_--cc_master +++ b/t/t4013/diff.diff-tree_--cc_master @@ -1,5 +1,5 @@ $ git diff-tree --cc master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 diff --cc dir/sub index cead32e,7289e35..992913c --- a/dir/sub diff --git a/t/t4013/diff.diff-tree_-c_--abbrev_master b/t/t4013/diff.diff-tree_-c_--abbrev_master index 39d511a7cf..b8e4aa2530 100644 --- a/t/t4013/diff.diff-tree_-c_--abbrev_master +++ b/t/t4013/diff.diff-tree_-c_--abbrev_master @@ -1,5 +1,5 @@ $ git diff-tree -c --abbrev master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 ::100644 100644 100644 cead32e... 7289e35... 992913c... MM dir/sub ::100644 100644 100644 b414108... f4615da... 10a8a9f... MM file0 $ diff --git a/t/t4013/diff.diff-tree_-c_--stat_--summary_master b/t/t4013/diff.diff-tree_-c_--stat_--summary_master index 2d239feb5d..ac9f641fb4 100644 --- a/t/t4013/diff.diff-tree_-c_--stat_--summary_master +++ b/t/t4013/diff.diff-tree_-c_--stat_--summary_master @@ -1,5 +1,5 @@ $ git diff-tree -c --stat --summary master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 dir/sub | 2 ++ file0 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.diff-tree_-c_--stat_master b/t/t4013/diff.diff-tree_-c_--stat_master index 226300b93c..c2fe6a98c5 100644 --- a/t/t4013/diff.diff-tree_-c_--stat_master +++ b/t/t4013/diff.diff-tree_-c_--stat_master @@ -1,5 +1,5 @@ $ git diff-tree -c --stat master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 dir/sub | 2 ++ file0 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.diff-tree_-c_master b/t/t4013/diff.diff-tree_-c_master index c258efe222..e2d2bb2611 100644 --- a/t/t4013/diff.diff-tree_-c_master +++ b/t/t4013/diff.diff-tree_-c_master @@ -1,5 +1,5 @@ $ git diff-tree -c master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 ::100644 100644 100644 cead32e925b1420c84c14cbf7cf755e7e45af8ad 7289e35bff32727c08dda207511bec138fdb9ea5 992913c5aa0a5476d10c49ed0f21fc0c6d1aedf3 MM dir/sub ::100644 100644 100644 b414108e81e5091fe0974a1858b4d0d22b107f70 f4615da674c09df322d6ba8d6b21ecfb1b1ba510 10a8a9f3657f91a156b9f0184ed79a20adef9f7f MM file0 $ diff --git a/t/t4013/diff.diff-tree_-p_-m_master b/t/t4013/diff.diff-tree_-p_-m_master index 1be721560a..b60bea039d 100644 --- a/t/t4013/diff.diff-tree_-p_-m_master +++ b/t/t4013/diff.diff-tree_-p_-m_master @@ -1,5 +1,5 @@ $ git diff-tree -p -m master -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 diff --git a/dir/sub b/dir/sub index cead32e..992913c 100644 --- a/dir/sub @@ -21,7 +21,7 @@ index b414108..10a8a9f 100644 +A +B +C -176b998f5d647cbd77a9d8acf4531e930754d16d +59d314ad6f356dd08601a4cd5e530381da3e3c64 diff --git a/dir/sub b/dir/sub index 7289e35..992913c 100644 --- a/dir/sub diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master index a89bbbbcfb..34af347d64 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master @@ -1,5 +1,5 @@ $ git format-patch --attach --stdout initial..master -From 7952a93e09bf565b5592766a438b40cd81f4846f Mon Sep 17 00:00:00 2001 +From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:01:00 +0000 Subject: [PATCH] Second @@ -11,6 +11,9 @@ This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit + + +This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ @@ -18,10 +21,10 @@ Content-Transfer-Encoding: 8bit 3 files changed, 5 insertions(+), 3 deletions(-) --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; - name="7952a93e09bf565b5592766a438b40cd81f4846f.diff" + name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" Content-Transfer-Encoding: 8bit Content-Disposition: inline; - filename="7952a93e09bf565b5592766a438b40cd81f4846f.diff" + filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 @@ -57,7 +60,7 @@ index 01e79c3..0000000 -From 889b315013ef9f2e2f90aa0b054b267c8a557847 Mon Sep 17 00:00:00 2001 +From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third @@ -75,10 +78,10 @@ Content-Transfer-Encoding: 8bit 2 files changed, 5 insertions(+), 0 deletions(-) --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; - name="889b315013ef9f2e2f90aa0b054b267c8a557847.diff" + name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" Content-Transfer-Encoding: 8bit Content-Disposition: inline; - filename="889b315013ef9f2e2f90aa0b054b267c8a557847.diff" + filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644 diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ index 4de9091a40..3d57510037 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ @@ -1,5 +1,5 @@ $ git format-patch --attach --stdout initial..master^ -From 7952a93e09bf565b5592766a438b40cd81f4846f Mon Sep 17 00:00:00 2001 +From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:01:00 +0000 Subject: [PATCH] Second @@ -11,6 +11,9 @@ This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit + + +This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ @@ -18,10 +21,10 @@ Content-Transfer-Encoding: 8bit 3 files changed, 5 insertions(+), 3 deletions(-) --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; - name="7952a93e09bf565b5592766a438b40cd81f4846f.diff" + name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" Content-Transfer-Encoding: 8bit Content-Disposition: inline; - filename="7952a93e09bf565b5592766a438b40cd81f4846f.diff" + filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 @@ -57,7 +60,7 @@ index 01e79c3..0000000 -From 889b315013ef9f2e2f90aa0b054b267c8a557847 Mon Sep 17 00:00:00 2001 +From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third @@ -75,10 +78,10 @@ Content-Transfer-Encoding: 8bit 2 files changed, 5 insertions(+), 0 deletions(-) --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; - name="889b315013ef9f2e2f90aa0b054b267c8a557847.diff" + name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" Content-Transfer-Encoding: 8bit Content-Disposition: inline; - filename="889b315013ef9f2e2f90aa0b054b267c8a557847.diff" + filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644 diff --git a/t/t4013/diff.format-patch_--stdout_initial..master b/t/t4013/diff.format-patch_--stdout_initial..master index b7b4e7ca91..fe78b15309 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--stdout_initial..master @@ -1,8 +1,10 @@ $ git format-patch --stdout initial..master -From 7952a93e09bf565b5592766a438b40cd81f4846f Mon Sep 17 00:00:00 2001 +From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:01:00 +0000 Subject: [PATCH] Second + +This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ @@ -42,7 +44,7 @@ index 01e79c3..0000000 g-i-t--v-e-r-s-i-o-n -From 889b315013ef9f2e2f90aa0b054b267c8a557847 Mon Sep 17 00:00:00 2001 +From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third diff --git a/t/t4013/diff.format-patch_--stdout_initial..master^ b/t/t4013/diff.format-patch_--stdout_initial..master^ index e56dd98df3..4e87689507 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--stdout_initial..master^ @@ -1,8 +1,10 @@ $ git format-patch --stdout initial..master^ -From 7952a93e09bf565b5592766a438b40cd81f4846f Mon Sep 17 00:00:00 2001 +From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:01:00 +0000 Subject: [PATCH] Second + +This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ @@ -42,7 +44,7 @@ index 01e79c3..0000000 g-i-t--v-e-r-s-i-o-n -From 889b315013ef9f2e2f90aa0b054b267c8a557847 Mon Sep 17 00:00:00 2001 +From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third diff --git a/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_ b/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_ index cc5537697d..3ceb8e73c5 100644 --- a/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_ +++ b/t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_ @@ -1,6 +1,6 @@ $ git log --patch-with-stat --summary master -- dir/ -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -25,7 +25,7 @@ index 35d242b..7289e35 100644 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -45,11 +45,13 @@ index 8422d40..cead32e 100644 +E +F -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.log_--patch-with-stat_master b/t/t4013/diff.log_--patch-with-stat_master index b97969dc98..43d77761f9 100644 --- a/t/t4013/diff.log_--patch-with-stat_master +++ b/t/t4013/diff.log_--patch-with-stat_master @@ -1,6 +1,6 @@ $ git log --patch-with-stat master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -48,7 +48,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -78,11 +78,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.log_--patch-with-stat_master_--_dir_ b/t/t4013/diff.log_--patch-with-stat_master_--_dir_ index 71a6d0f853..5187a26816 100644 --- a/t/t4013/diff.log_--patch-with-stat_master_--_dir_ +++ b/t/t4013/diff.log_--patch-with-stat_master_--_dir_ @@ -1,6 +1,6 @@ $ git log --patch-with-stat master -- dir/ -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -25,7 +25,7 @@ index 35d242b..7289e35 100644 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -45,11 +45,13 @@ index 8422d40..cead32e 100644 +E +F -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master index b652c6a823..c9640976a8 100644 --- a/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master +++ b/t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master @@ -1,6 +1,6 @@ $ git log --root --cc --patch-with-stat --summary master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -81,7 +81,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -112,11 +112,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.log_--root_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_--patch-with-stat_--summary_master index b24a504759..ad050af55f 100644 --- a/t/t4013/diff.log_--root_--patch-with-stat_--summary_master +++ b/t/t4013/diff.log_--root_--patch-with-stat_--summary_master @@ -1,6 +1,6 @@ $ git log --root --patch-with-stat --summary master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -49,7 +49,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -80,11 +80,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.log_--root_--patch-with-stat_master b/t/t4013/diff.log_--root_--patch-with-stat_master index 1e9bdc4c1c..628c6c03bc 100644 --- a/t/t4013/diff.log_--root_--patch-with-stat_master +++ b/t/t4013/diff.log_--root_--patch-with-stat_master @@ -1,6 +1,6 @@ $ git log --root --patch-with-stat master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -48,7 +48,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -78,11 +78,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master b/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master index 3a155d288c..5d4e0f13b5 100644 --- a/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master +++ b/t/t4013/diff.log_--root_-c_--patch-with-stat_--summary_master @@ -1,6 +1,6 @@ $ git log --root -c --patch-with-stat --summary master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -81,7 +81,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -112,11 +112,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.log_--root_-p_master b/t/t4013/diff.log_--root_-p_master index 2296986ad1..217a2eb203 100644 --- a/t/t4013/diff.log_--root_-p_master +++ b/t/t4013/diff.log_--root_-p_master @@ -1,6 +1,6 @@ $ git log --root -p master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -43,7 +43,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -69,11 +69,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 diff --git a/t/t4013/diff.log_--root_master b/t/t4013/diff.log_--root_master index 7554a468d1..e17ccfc234 100644 --- a/t/t4013/diff.log_--root_master +++ b/t/t4013/diff.log_--root_master @@ -1,6 +1,6 @@ $ git log --root master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -12,17 +12,19 @@ Date: Mon Jun 26 00:03:00 2006 +0000 Side -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 Third -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. commit 444ac553ac7612cc88969031b02b3767fb8a353a Author: A U Thor diff --git a/t/t4013/diff.log_-SF_-p_master b/t/t4013/diff.log_-SF_-p_master index db2264c6e9..5e32438972 100644 --- a/t/t4013/diff.log_-SF_-p_master +++ b/t/t4013/diff.log_-SF_-p_master @@ -1,5 +1,5 @@ $ git log -SF -p master -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 diff --git a/t/t4013/diff.log_-SF_master b/t/t4013/diff.log_-SF_master index f307b4d2a8..6162ed2018 100644 --- a/t/t4013/diff.log_-SF_master +++ b/t/t4013/diff.log_-SF_master @@ -1,5 +1,5 @@ $ git log -SF master -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 diff --git a/t/t4013/diff.log_-p_master b/t/t4013/diff.log_-p_master index e82a72f6f8..f8fefef2c3 100644 --- a/t/t4013/diff.log_-p_master +++ b/t/t4013/diff.log_-p_master @@ -1,6 +1,6 @@ $ git log -p master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -43,7 +43,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -69,11 +69,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 diff --git a/t/t4013/diff.log_master b/t/t4013/diff.log_master index 7b86ed1f5d..e9d9e7b40a 100644 --- a/t/t4013/diff.log_master +++ b/t/t4013/diff.log_master @@ -1,6 +1,6 @@ $ git log master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -12,17 +12,19 @@ Date: Mon Jun 26 00:03:00 2006 +0000 Side -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 Third -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. commit 444ac553ac7612cc88969031b02b3767fb8a353a Author: A U Thor diff --git a/t/t4013/diff.show_master b/t/t4013/diff.show_master index 3772a87e13..9e6e1f2710 100644 --- a/t/t4013/diff.show_master +++ b/t/t4013/diff.show_master @@ -1,6 +1,6 @@ $ git show master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 diff --git a/t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ b/t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ index 054513f312..6a467cccc1 100644 --- a/t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ +++ b/t/t4013/diff.whatchanged_--patch-with-stat_--summary_master_--_dir_ @@ -18,7 +18,7 @@ index 35d242b..7289e35 100644 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -38,11 +38,13 @@ index 8422d40..cead32e 100644 +E +F -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.whatchanged_--patch-with-stat_master b/t/t4013/diff.whatchanged_--patch-with-stat_master index a89b573f45..1e1bbe1963 100644 --- a/t/t4013/diff.whatchanged_--patch-with-stat_master +++ b/t/t4013/diff.whatchanged_--patch-with-stat_master @@ -41,7 +41,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -71,11 +71,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_ b/t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_ index b6d9752164..13789f169b 100644 --- a/t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_ +++ b/t/t4013/diff.whatchanged_--patch-with-stat_master_--_dir_ @@ -18,7 +18,7 @@ index 35d242b..7289e35 100644 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -38,11 +38,13 @@ index 8422d40..cead32e 100644 +E +F -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master b/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master index e9e17cdafb..5facf2543d 100644 --- a/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master +++ b/t/t4013/diff.whatchanged_--root_--cc_--patch-with-stat_--summary_master @@ -1,6 +1,6 @@ $ git whatchanged --root --cc --patch-with-stat --summary master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -81,7 +81,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -112,11 +112,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master b/t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master index f707bfa3a1..0291153587 100644 --- a/t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master +++ b/t/t4013/diff.whatchanged_--root_--patch-with-stat_--summary_master @@ -42,7 +42,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -73,11 +73,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.whatchanged_--root_--patch-with-stat_master b/t/t4013/diff.whatchanged_--root_--patch-with-stat_master index 61aca41711..9b0349cd55 100644 --- a/t/t4013/diff.whatchanged_--root_--patch-with-stat_master +++ b/t/t4013/diff.whatchanged_--root_--patch-with-stat_master @@ -41,7 +41,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -71,11 +71,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master b/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master index 596765e804..10f6767e49 100644 --- a/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master +++ b/t/t4013/diff.whatchanged_--root_-c_--patch-with-stat_--summary_master @@ -1,6 +1,6 @@ $ git whatchanged --root -c --patch-with-stat --summary master -commit 176b998f5d647cbd77a9d8acf4531e930754d16d -Merge: 889b315... c7a2ab9... +commit 59d314ad6f356dd08601a4cd5e530381da3e3c64 +Merge: 9a6d494... c7a2ab9... Author: A U Thor Date: Mon Jun 26 00:04:00 2006 +0000 @@ -81,7 +81,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -112,11 +112,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.whatchanged_--root_-p_master b/t/t4013/diff.whatchanged_--root_-p_master index b4cd05e576..ebf1f0661e 100644 --- a/t/t4013/diff.whatchanged_--root_-p_master +++ b/t/t4013/diff.whatchanged_--root_-p_master @@ -36,7 +36,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -62,11 +62,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 diff --git a/t/t4013/diff.whatchanged_--root_master b/t/t4013/diff.whatchanged_--root_master index 011a22178f..a405cb6138 100644 --- a/t/t4013/diff.whatchanged_--root_master +++ b/t/t4013/diff.whatchanged_--root_master @@ -9,7 +9,7 @@ Date: Mon Jun 26 00:03:00 2006 +0000 :100644 100644 01e79c3... f4615da... M file0 :000000 100644 0000000... 7289e35... A file3 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -18,11 +18,13 @@ Date: Mon Jun 26 00:02:00 2006 +0000 :100644 100644 8422d40... cead32e... M dir/sub :000000 100644 0000000... b1e6722... A file1 -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. :100644 100644 35d242b... 8422d40... M dir/sub :100644 100644 01e79c3... b414108... M file0 diff --git a/t/t4013/diff.whatchanged_-SF_-p_master b/t/t4013/diff.whatchanged_-SF_-p_master index 6a76f4e604..f39da84822 100644 --- a/t/t4013/diff.whatchanged_-SF_-p_master +++ b/t/t4013/diff.whatchanged_-SF_-p_master @@ -1,5 +1,5 @@ $ git whatchanged -SF -p master -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 diff --git a/t/t4013/diff.whatchanged_-SF_master b/t/t4013/diff.whatchanged_-SF_master index a4fe6f8a39..0499321d0e 100644 --- a/t/t4013/diff.whatchanged_-SF_master +++ b/t/t4013/diff.whatchanged_-SF_master @@ -1,5 +1,5 @@ $ git whatchanged -SF master -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 diff --git a/t/t4013/diff.whatchanged_-p_master b/t/t4013/diff.whatchanged_-p_master index f9a4456725..f18d43209c 100644 --- a/t/t4013/diff.whatchanged_-p_master +++ b/t/t4013/diff.whatchanged_-p_master @@ -36,7 +36,7 @@ index 0000000..7289e35 +1 +2 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -62,11 +62,13 @@ index 0000000..b1e6722 +B +C -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 diff --git a/t/t4013/diff.whatchanged_master b/t/t4013/diff.whatchanged_master index c22416c006..cd3bcc2c72 100644 --- a/t/t4013/diff.whatchanged_master +++ b/t/t4013/diff.whatchanged_master @@ -9,7 +9,7 @@ Date: Mon Jun 26 00:03:00 2006 +0000 :100644 100644 01e79c3... f4615da... M file0 :000000 100644 0000000... 7289e35... A file3 -commit 889b315013ef9f2e2f90aa0b054b267c8a557847 +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Author: A U Thor Date: Mon Jun 26 00:02:00 2006 +0000 @@ -18,11 +18,13 @@ Date: Mon Jun 26 00:02:00 2006 +0000 :100644 100644 8422d40... cead32e... M dir/sub :000000 100644 0000000... b1e6722... A file1 -commit 7952a93e09bf565b5592766a438b40cd81f4846f +commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Author: A U Thor Date: Mon Jun 26 00:01:00 2006 +0000 Second + + This is the second commit. :100644 100644 35d242b... 8422d40... M dir/sub :100644 100644 01e79c3... b414108... M file0 From 19b3bd3e2d260323c5e727212a6dcd7fc0f7aa07 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 13 Jul 2006 23:17:22 +0100 Subject: [PATCH 04/17] format-patch: Generate a newline between the subject header and the message body format-patch previously didn't generate a newline after a subject. This caused the diffstat to not be displayed in messages with only one line for the commit message. This patch fixes this by adding a newline after the headers if a body hasn't been added. Signed-off-by: Robert Shearman Signed-off-by: Junio C Hamano --- commit.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/commit.c b/commit.c index 522a6f3aca..6ac3bf7554 100644 --- a/commit.c +++ b/commit.c @@ -655,6 +655,9 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit continue; } + if (!subject) + body = 1; + if (is_empty_line(line, &linelen)) { if (!body) continue; @@ -662,8 +665,6 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit continue; if (fmt == CMIT_FMT_SHORT) break; - } else { - body = 1; } if (subject) { @@ -702,6 +703,12 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit /* Make sure there is an EOLN for the non-oneline case */ if (fmt != CMIT_FMT_ONELINE) buf[offset++] = '\n'; + /* + * make sure there is another EOLN to separate the headers from whatever + * body the caller appends if we haven't already written a body + */ + if (fmt == CMIT_FMT_EMAIL && !body) + buf[offset++] = '\n'; buf[offset] = '\0'; return offset; } From 855409296d74d3e53fdaa3cdefd1171e4c950fab Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 13 Jul 2006 21:39:13 -0700 Subject: [PATCH 05/17] Adjust t4013 tests to corrected format-patch. Signed-off-by: Junio C Hamano --- t/t4013/diff.format-patch_--attach_--stdout_initial..master | 2 ++ t/t4013/diff.format-patch_--attach_--stdout_initial..master^ | 1 + t/t4013/diff.format-patch_--attach_--stdout_initial..side | 1 + t/t4013/diff.format-patch_--stdout_initial..master | 2 ++ t/t4013/diff.format-patch_--stdout_initial..master^ | 1 + t/t4013/diff.format-patch_--stdout_initial..side | 1 + 6 files changed, 8 insertions(+) diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master index 34af347d64..b4745e1001 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master @@ -72,6 +72,7 @@ This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit + --- dir/sub | 2 ++ file1 | 3 +++ @@ -119,6 +120,7 @@ This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit + --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ index 3d57510037..a9d1cd368b 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ @@ -72,6 +72,7 @@ This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit + --- dir/sub | 2 ++ file1 | 3 +++ diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side index 3769fa6daf..57b9d0bdc1 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side @@ -11,6 +11,7 @@ This is a multi-part message in MIME format. --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit + --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.format-patch_--stdout_initial..master b/t/t4013/diff.format-patch_--stdout_initial..master index fe78b15309..c33302e92f 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--stdout_initial..master @@ -48,6 +48,7 @@ From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third + --- dir/sub | 2 ++ file1 | 3 +++ @@ -80,6 +81,7 @@ From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:03:00 +0000 Subject: [PATCH] Side + --- dir/sub | 2 ++ file0 | 3 +++ diff --git a/t/t4013/diff.format-patch_--stdout_initial..master^ b/t/t4013/diff.format-patch_--stdout_initial..master^ index 4e87689507..03d0f9693c 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--stdout_initial..master^ @@ -48,6 +48,7 @@ From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:02:00 +0000 Subject: [PATCH] Third + --- dir/sub | 2 ++ file1 | 3 +++ diff --git a/t/t4013/diff.format-patch_--stdout_initial..side b/t/t4013/diff.format-patch_--stdout_initial..side index e7ddbf4814..d10a46523b 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..side +++ b/t/t4013/diff.format-patch_--stdout_initial..side @@ -3,6 +3,7 @@ From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 From: A U Thor Date: Mon, 26 Jun 2006 00:03:00 +0000 Subject: [PATCH] Side + --- dir/sub | 2 ++ file0 | 3 +++ From 8d5e26848d0ddd5063f078b0c34c6c48b68d0d94 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 13 Jul 2006 21:48:45 -0700 Subject: [PATCH 06/17] Documentation: Fix ssh://[user@]host.xz URL Earlier commit c3f17061 broke asciidoc markup. Noticed by Alp Toker with a fix, but fixed up in a way with smaller formatting impact. Signed-off-by: Junio C Hamano --- Documentation/urls.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/urls.txt b/Documentation/urls.txt index 9abec806d9..93378d2378 100644 --- a/Documentation/urls.txt +++ b/Documentation/urls.txt @@ -10,9 +10,9 @@ to name the remote repository: - https://host.xz/path/to/repo.git/ - git://host.xz/path/to/repo.git/ - git://host.xz/~user/path/to/repo.git/ -- ssh://[user@]host.xz/path/to/repo.git/ -- ssh://[user@]host.xz/~user/path/to/repo.git/ -- ssh://[user@]host.xz/~/path/to/repo.git +- ssh://+++[user@+++]host.xz/path/to/repo.git/ +- ssh://+++[user@+++]host.xz/~user/path/to/repo.git/ +- ssh://+++[user@+++]host.xz/~/path/to/repo.git =============================================================== SSH Is the default transport protocol and also supports an From ad8b4f56b5ec1e5385156c20d95649ea8cee6af4 Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Thu, 13 Jul 2006 12:02:29 +0200 Subject: [PATCH 07/17] daemon: use a custom die routine with syslog Removed the git-daemon prefix from die() because no other call to die does this. Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- daemon.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/daemon.c b/daemon.c index e096bd7ef6..a7636bc50c 100644 --- a/daemon.c +++ b/daemon.c @@ -95,6 +95,12 @@ static void loginfo(const char *err, ...) va_end(params); } +static void NORETURN daemon_die(const char *err, va_list params) +{ + logreport(LOG_ERR, err, params); + exit(1); +} + static int avoid_alias(char *p) { int sl, ndot; @@ -746,17 +752,14 @@ int main(int argc, char **argv) usage(daemon_usage); } - if (log_syslog) + if (log_syslog) { openlog("git-daemon", 0, LOG_DAEMON); - - if (strict_paths && (!ok_paths || !*ok_paths)) { - if (!inetd_mode) - die("git-daemon: option --strict-paths requires a whitelist"); - - logerror("option --strict-paths requires a whitelist"); - exit (1); + set_die_routine(daemon_die); } + if (strict_paths && (!ok_paths || !*ok_paths)) + die("option --strict-paths requires a whitelist"); + if (inetd_mode) { struct sockaddr_storage ss; struct sockaddr *peer = (struct sockaddr *)&ss; From 258e93a155f88fd7385e4d1e26f287044ba973e9 Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Thu, 13 Jul 2006 18:32:11 +0200 Subject: [PATCH 08/17] daemon: if one of the standard fds is missing open it to /dev/null Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- daemon.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/daemon.c b/daemon.c index a7636bc50c..01ccda33ea 100644 --- a/daemon.c +++ b/daemon.c @@ -662,6 +662,18 @@ static int service_loop(int socknum, int *socklist) } } +/* if any standard file descriptor is missing open it to /dev/null */ +static void sanitize_stdfds(void) +{ + int fd = open("/dev/null", O_RDWR, 0); + while (fd != -1 && fd < 2) + fd = dup(fd); + if (fd == -1) + die("open /dev/null or dup failed: %s", strerror(errno)); + if (fd > 2) + close(fd); +} + static int serve(int port) { int socknum, *socklist; @@ -773,5 +785,7 @@ int main(int argc, char **argv) return execute(peer); } + sanitize_stdfds(); + return serve(port); } From 5f490ce03c16411b737374c12ed377c74af1ca9d Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Thu, 13 Jul 2006 13:07:59 +0200 Subject: [PATCH 09/17] upload-pack: ignore write errors to stderr Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- upload-pack.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/upload-pack.c b/upload-pack.c index b18eb9ba0d..94aa0dab48 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -51,6 +51,10 @@ static ssize_t send_client_data(int fd, const char *data, ssize_t sz) if (fd == 3) /* emergency quit */ fd = 2; + if (fd == 2) { + xwrite(fd, data, sz); + return sz; + } return safe_write(fd, data, sz); } p = data; From 45ed5d7f4cf641d1f64a83613f5a29b31268f8e8 Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Thu, 13 Jul 2006 12:18:08 +0200 Subject: [PATCH 10/17] daemon: new option --pid-file= to store the pid Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- daemon.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/daemon.c b/daemon.c index 01ccda33ea..cdc4266863 100644 --- a/daemon.c +++ b/daemon.c @@ -674,6 +674,15 @@ static void sanitize_stdfds(void) close(fd); } +static void store_pid(const char *path) +{ + FILE *f = fopen(path, "w"); + if (!f) + die("cannot open pid file %s: %s", path, strerror(errno)); + fprintf(f, "%d\n", getpid()); + fclose(f); +} + static int serve(int port) { int socknum, *socklist; @@ -689,6 +698,7 @@ int main(int argc, char **argv) { int port = DEFAULT_GIT_PORT; int inetd_mode = 0; + const char *pid_file = NULL; int i; /* Without this we cannot rely on waitpid() to tell @@ -753,6 +763,10 @@ int main(int argc, char **argv) user_path = arg + 12; continue; } + if (!strncmp(arg, "--pid-file=", 11)) { + pid_file = arg + 11; + continue; + } if (!strcmp(arg, "--")) { ok_paths = &argv[i+1]; break; @@ -787,5 +801,8 @@ int main(int argc, char **argv) sanitize_stdfds(); + if (pid_file) + store_pid(pid_file); + return serve(port); } From a5262768e1e4af96bbca60ee712e97105f80de24 Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Thu, 13 Jul 2006 18:47:13 +0200 Subject: [PATCH 11/17] daemon: new option --detach to run git-daemon in background Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- daemon.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/daemon.c b/daemon.c index cdc4266863..e4ec676301 100644 --- a/daemon.c +++ b/daemon.c @@ -674,6 +674,24 @@ static void sanitize_stdfds(void) close(fd); } +static void daemonize(void) +{ + switch (fork()) { + case 0: + break; + case -1: + die("fork failed: %s", strerror(errno)); + default: + exit(0); + } + if (setsid() == -1) + die("setsid failed: %s", strerror(errno)); + close(0); + close(1); + close(2); + sanitize_stdfds(); +} + static void store_pid(const char *path) { FILE *f = fopen(path, "w"); @@ -699,6 +717,7 @@ int main(int argc, char **argv) int port = DEFAULT_GIT_PORT; int inetd_mode = 0; const char *pid_file = NULL; + int detach = 0; int i; /* Without this we cannot rely on waitpid() to tell @@ -767,6 +786,11 @@ int main(int argc, char **argv) pid_file = arg + 11; continue; } + if (!strcmp(arg, "--detach")) { + detach = 1; + log_syslog = 1; + continue; + } if (!strcmp(arg, "--")) { ok_paths = &argv[i+1]; break; @@ -799,7 +823,10 @@ int main(int argc, char **argv) return execute(peer); } - sanitize_stdfds(); + if (detach) + daemonize(); + else + sanitize_stdfds(); if (pid_file) store_pid(pid_file); From ff4d78041e85d1eddb17f2eee497e29aaeee4564 Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Wed, 12 Jul 2006 21:54:51 +0200 Subject: [PATCH 12/17] Documentation about exclude/ignore files Use .git/info/exclude in the example in git-ls-files.txt, instead of .git/ignore, and update the list of commands looking at .git/info/exclude in repository-layout.txt. Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- Documentation/git-ls-files.txt | 4 ++-- Documentation/repository-layout.txt | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt index 4d8a2ad2d7..8520b97111 100644 --- a/Documentation/git-ls-files.txt +++ b/Documentation/git-ls-files.txt @@ -207,7 +207,7 @@ An exclude pattern is of the following format: An example: -------------------------------------------------------------- - $ cat .git/ignore + $ cat .git/info/exclude # ignore objects and archives, anywhere in the tree. *.[oa] $ cat Documentation/.gitignore @@ -217,7 +217,7 @@ An example: !foo.html $ git-ls-files --ignored \ --exclude='Documentation/*.[0-9]' \ - --exclude-from=.git/ignore \ + --exclude-from=.git/info/exclude \ --exclude-per-directory=.gitignore -------------------------------------------------------------- diff --git a/Documentation/repository-layout.txt b/Documentation/repository-layout.txt index b52dfdc308..275d18bb54 100644 --- a/Documentation/repository-layout.txt +++ b/Documentation/repository-layout.txt @@ -120,9 +120,11 @@ info/grafts:: info/exclude:: This file, by convention among Porcelains, stores the - exclude pattern list. `git status` looks at it, but - otherwise it is not looked at by any of the core git - commands. + exclude pattern list. `.gitignore` is the per-directory + ignore file. `git status`, `git add`, `git rm` and `git + clean` look at it but the core git commands do not look + at it. See also: gitlink:git-ls-files[1] `--exclude-from` + and `--exclude-per-directory`. remotes:: Stores shorthands to be used to give URL and default From f37399e6b0689b8b9a5a4cf9149ede5a39fca549 Mon Sep 17 00:00:00 2001 From: Timo Hirvonen Date: Thu, 13 Jul 2006 19:06:12 +0300 Subject: [PATCH 13/17] diff: Support both attributes and colors Make it possible to set both colors and a attribute for diff colors. Background colors are supported too. Syntax is now: [attr] [fg [bg]] [fg [bg]] [attr] Empty value is same as "normal normal", ie use default colors. The new syntax is backwards compatible. Signed-off-by: Timo Hirvonen Signed-off-by: Junio C Hamano --- diff.c | 162 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 106 insertions(+), 56 deletions(-) diff --git a/diff.c b/diff.c index 287a927ce3..f350c6ba91 100644 --- a/diff.c +++ b/diff.c @@ -26,30 +26,14 @@ enum color_diff { DIFF_FILE_NEW = 5, }; -#define COLOR_NORMAL "" -#define COLOR_BOLD "\033[1m" -#define COLOR_DIM "\033[2m" -#define COLOR_UL "\033[4m" -#define COLOR_BLINK "\033[5m" -#define COLOR_REVERSE "\033[7m" -#define COLOR_RESET "\033[m" - -#define COLOR_BLACK "\033[30m" -#define COLOR_RED "\033[31m" -#define COLOR_GREEN "\033[32m" -#define COLOR_YELLOW "\033[33m" -#define COLOR_BLUE "\033[34m" -#define COLOR_MAGENTA "\033[35m" -#define COLOR_CYAN "\033[36m" -#define COLOR_WHITE "\033[37m" - -static const char *diff_colors[] = { - COLOR_RESET, - COLOR_NORMAL, - COLOR_BOLD, - COLOR_CYAN, - COLOR_RED, - COLOR_GREEN +/* "\033[1;30;47m\0" is 11 bytes */ +static char diff_colors[][16] = { + "\033[m", /* reset */ + "", /* normal */ + "\033[1m", /* bold */ + "\033[36m", /* cyan */ + "\033[31m", /* red */ + "\033[32m" /* green */ }; static int parse_diff_color_slot(const char *var, int ofs) @@ -67,38 +51,104 @@ static int parse_diff_color_slot(const char *var, int ofs) die("bad config variable '%s'", var); } -static const char *parse_diff_color_value(const char *value, const char *var) +static int parse_color(const char *name, int len) { - if (!strcasecmp(value, "normal")) - return COLOR_NORMAL; - if (!strcasecmp(value, "bold")) - return COLOR_BOLD; - if (!strcasecmp(value, "dim")) - return COLOR_DIM; - if (!strcasecmp(value, "ul")) - return COLOR_UL; - if (!strcasecmp(value, "blink")) - return COLOR_BLINK; - if (!strcasecmp(value, "reverse")) - return COLOR_REVERSE; - if (!strcasecmp(value, "reset")) - return COLOR_RESET; - if (!strcasecmp(value, "black")) - return COLOR_BLACK; - if (!strcasecmp(value, "red")) - return COLOR_RED; - if (!strcasecmp(value, "green")) - return COLOR_GREEN; - if (!strcasecmp(value, "yellow")) - return COLOR_YELLOW; - if (!strcasecmp(value, "blue")) - return COLOR_BLUE; - if (!strcasecmp(value, "magenta")) - return COLOR_MAGENTA; - if (!strcasecmp(value, "cyan")) - return COLOR_CYAN; - if (!strcasecmp(value, "white")) - return COLOR_WHITE; + static const char * const color_names[] = { + "normal", "black", "red", "green", "yellow", + "blue", "magenta", "cyan", "white" + }; + int i; + for (i = 0; i < ARRAY_SIZE(color_names); i++) { + const char *str = color_names[i]; + if (!strncasecmp(name, str, len) && !str[len]) + return i - 1; + } + return -2; +} + +static int parse_attr(const char *name, int len) +{ + static const int attr_values[] = { 1, 2, 4, 5, 7 }; + static const char * const attr_names[] = { + "bold", "dim", "ul", "blink", "reverse" + }; + int i; + for (i = 0; i < ARRAY_SIZE(attr_names); i++) { + const char *str = attr_names[i]; + if (!strncasecmp(name, str, len) && !str[len]) + return attr_values[i]; + } + return -1; +} + +static void parse_diff_color_value(const char *value, const char *var, char *dst) +{ + const char *ptr = value; + int attr = -1; + int fg = -2; + int bg = -2; + + if (!strcasecmp(value, "reset")) { + strcpy(dst, "\033[m"); + return; + } + + /* [fg [bg]] [attr] */ + while (*ptr) { + const char *word = ptr; + int val, len = 0; + + while (word[len] && !isspace(word[len])) + len++; + + ptr = word + len; + while (*ptr && isspace(*ptr)) + ptr++; + + val = parse_color(word, len); + if (val >= -1) { + if (fg == -2) { + fg = val; + continue; + } + if (bg == -2) { + bg = val; + continue; + } + goto bad; + } + val = parse_attr(word, len); + if (val < 0 || attr != -1) + goto bad; + attr = val; + } + + if (attr >= 0 || fg >= 0 || bg >= 0) { + int sep = 0; + + *dst++ = '\033'; + *dst++ = '['; + if (attr >= 0) { + *dst++ = '0' + attr; + sep++; + } + if (fg >= 0) { + if (sep++) + *dst++ = ';'; + *dst++ = '3'; + *dst++ = '0' + fg; + } + if (bg >= 0) { + if (sep++) + *dst++ = ';'; + *dst++ = '4'; + *dst++ = '0' + bg; + } + *dst++ = 'm'; + } + *dst = 0; + return; +bad: die("bad config value '%s' for variable '%s'", value, var); } @@ -145,7 +195,7 @@ int git_diff_ui_config(const char *var, const char *value) } if (!strncmp(var, "diff.color.", 11)) { int slot = parse_diff_color_slot(var, 11); - diff_colors[slot] = parse_diff_color_value(value, var); + parse_diff_color_value(value, var, diff_colors[slot]); return 0; } return git_default_config(var, value); From f5b571fcf7929ca6e85b3c35c4bb96db305d0b1e Mon Sep 17 00:00:00 2001 From: Timo Hirvonen Date: Thu, 13 Jul 2006 19:08:06 +0300 Subject: [PATCH 14/17] diff: Support 256 colors Add support for more than 8 colors. Colors can be specified as numbers -1..255. -1 is same as "normal". Signed-off-by: Timo Hirvonen Signed-off-by: Junio C Hamano --- diff.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/diff.c b/diff.c index f350c6ba91..8b44756136 100644 --- a/diff.c +++ b/diff.c @@ -26,8 +26,8 @@ enum color_diff { DIFF_FILE_NEW = 5, }; -/* "\033[1;30;47m\0" is 11 bytes */ -static char diff_colors[][16] = { +/* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */ +static char diff_colors[][24] = { "\033[m", /* reset */ "", /* normal */ "\033[1m", /* bold */ @@ -57,12 +57,16 @@ static int parse_color(const char *name, int len) "normal", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" }; + char *end; int i; for (i = 0; i < ARRAY_SIZE(color_names); i++) { const char *str = color_names[i]; if (!strncasecmp(name, str, len) && !str[len]) return i - 1; } + i = strtol(name, &end, 10); + if (*name && !*end && i >= -1 && i <= 255) + return i; return -2; } @@ -135,14 +139,22 @@ static void parse_diff_color_value(const char *value, const char *var, char *dst if (fg >= 0) { if (sep++) *dst++ = ';'; - *dst++ = '3'; - *dst++ = '0' + fg; + if (fg < 8) { + *dst++ = '3'; + *dst++ = '0' + fg; + } else { + dst += sprintf(dst, "38;5;%d", fg); + } } if (bg >= 0) { if (sep++) *dst++ = ';'; - *dst++ = '4'; - *dst++ = '0' + bg; + if (bg < 8) { + *dst++ = '4'; + *dst++ = '0' + bg; + } else { + dst += sprintf(dst, "48;5;%d", bg); + } } *dst++ = 'm'; } From 3dffd2c82862f3e49dd9399adb480cd80d4f34ae Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 13 Jul 2006 10:30:43 +0200 Subject: [PATCH 15/17] Do not use perl in git-commit.sh git-commit.sh has the only one place where perl is used and there it can quite trivially be done in sh. git-ls-files without "-z" produces quoted output, even if is different from that produced by perl code it is good enough. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- git-commit.sh | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/git-commit.sh b/git-commit.sh index 802dd7243e..4cf3fab05c 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -138,32 +138,26 @@ run_status () { if test -z "$untracked_files"; then option="--directory --no-empty-directory" fi + hdr_shown= if test -f "$GIT_DIR/info/exclude" then - git-ls-files -z --others $option \ + git-ls-files --others $option \ --exclude-from="$GIT_DIR/info/exclude" \ --exclude-per-directory=.gitignore else - git-ls-files -z --others $option \ + git-ls-files --others $option \ --exclude-per-directory=.gitignore fi | - @@PERL@@ -e '$/ = "\0"; - my $shown = 0; - while (<>) { - chomp; - s|\\|\\\\|g; - s|\t|\\t|g; - s|\n|\\n|g; - s/^/# /; - if (!$shown) { - print "#\n# Untracked files:\n"; - print "# (use \"git add\" to add to commit)\n"; - print "#\n"; - $shown = 1; - } - print "$_\n"; - } - ' + while read line; do + if [ -z "$hdr_shown" ]; then + echo '#' + echo '# Untracked files:' + echo '# (use "git add" to add to commit)' + echo '#' + hdr_shown=1 + fi + echo "# $line" + done if test -n "$verbose" -a -z "$IS_INITIAL" then From 4b7ce6e2d6ba088da50de1df38b040ea2c0b8f18 Mon Sep 17 00:00:00 2001 From: Luben Tuikov Date: Thu, 13 Jul 2006 12:36:22 -0700 Subject: [PATCH 16/17] gitweb.css: Use monospace fonts for commits and tree-diff. Use monospace fonts for the commit header, commit message, and tree-diff. This helps viewing commit logs with ASCII art. Signed-off-by: Luben Tuikov Signed-off-by: Junio C Hamano --- gitweb/gitweb.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css index 98410f5b6c..fffdb13d09 100644 --- a/gitweb/gitweb.css +++ b/gitweb/gitweb.css @@ -60,6 +60,7 @@ div.page_footer_text { div.page_body { padding: 8px; + font-family: monospace; } div.title, a.title { @@ -79,6 +80,7 @@ div.title_text { padding: 6px 0px; border: solid #d9d8d1; border-width: 0px 0px 1px; + font-family: monospace; } div.log_body { @@ -142,10 +144,15 @@ table { padding: 8px 4px; } -table.project_list, table.diff_tree { +table.project_list { border-spacing: 0; } +table.diff_tree { + border-spacing: 0; + font-family: monospace; +} + table.blame { border-collapse: collapse; } From 57a39690b936c003662b6710241732b980e58790 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 10 Jul 2006 03:34:34 -0700 Subject: [PATCH 17/17] fetch/clone: check return status from ls-remote Some callers of ls-remote did not check its return status. --- git-clone.sh | 4 ++-- git-fetch.sh | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/git-clone.sh b/git-clone.sh index 0368803883..a92b22a13d 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -266,7 +266,7 @@ yes,yes) echo "$repo/objects" >> "$GIT_DIR/objects/info/alternates" ;; esac - git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" + git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1 ;; *) case "$repo" in @@ -296,7 +296,7 @@ yes,yes) done rm -f "$GIT_DIR/TMP_ALT" fi - git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" + git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1 ;; http://*) if test -z "@@NO_CURL@@" diff --git a/git-fetch.sh b/git-fetch.sh index ff1769952b..0c7a11d565 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -223,9 +223,16 @@ reflist=$(get_remote_refs_for_fetch "$@") if test "$tags" then taglist=`IFS=" " && - git-ls-remote $upload_pack --tags "$remote" | + ( + git-ls-remote $upload_pack --tags "$remote" || + echo fail ouch + ) | while read sha1 name do + case "$sha1" in + fail) + exit 1 + esac case "$name" in *^*) continue ;; esac @@ -235,7 +242,7 @@ then else echo >&2 "warning: tag ${name} ignored" fi - done` + done` || exit if test "$#" -gt 1 then # remote URL plus explicit refspecs; we need to merge them.