author | Junio C Hamano <gitster@pobox.com> | |
Mon, 28 Dec 2009 07:01:32 +0000 (23:01 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 28 Dec 2009 07:01:32 +0000 (23:01 -0800) |
* jk/1.7.0-status:
status/commit: do not suggest "reset HEAD <path>" while merging
commit/status: "git add <path>" is not necessarily how to resolve
commit/status: check $GIT_DIR/MERGE_HEAD only once
t7508-status: test all modes with color
t7508-status: status --porcelain ignores relative paths setting
status: reduce duplicated setup code
status: disable color for porcelain format
status -s: obey color.status
builtin-commit: refactor short-status code into wt-status.c
t7508-status.sh: Add tests for status -s
status -s: respect the status.relativePaths option
docs: note that status configuration affects only long format
commit: support alternate status formats
status: add --porcelain output format
status: refactor format option parsing
status: refactor short-mode printing to its own function
status: typo fix in usage
git status: not "commit --dry-run" anymore
git stat -s: short status output
git stat: the beginning of "status that is not a dry-run of commit"
Conflicts:
t/t4034-diff-words.sh
wt-status.c
status/commit: do not suggest "reset HEAD <path>" while merging
commit/status: "git add <path>" is not necessarily how to resolve
commit/status: check $GIT_DIR/MERGE_HEAD only once
t7508-status: test all modes with color
t7508-status: status --porcelain ignores relative paths setting
status: reduce duplicated setup code
status: disable color for porcelain format
status -s: obey color.status
builtin-commit: refactor short-status code into wt-status.c
t7508-status.sh: Add tests for status -s
status -s: respect the status.relativePaths option
docs: note that status configuration affects only long format
commit: support alternate status formats
status: add --porcelain output format
status: refactor format option parsing
status: refactor short-mode printing to its own function
status: typo fix in usage
git status: not "commit --dry-run" anymore
git stat -s: short status output
git stat: the beginning of "status that is not a dry-run of commit"
Conflicts:
t/t4034-diff-words.sh
wt-status.c
1 | 2 | |||
---|---|---|---|---|
Documentation/git-commit.txt | patch | | diff1 | | diff2 | | blob | history |
builtin-commit.c | patch | | diff1 | | diff2 | | blob | history |
t/t4034-diff-words.sh | patch | | diff1 | | diff2 | | blob | history |
t/test-lib.sh | patch | | diff1 | | diff2 | | blob | history |
wt-status.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc Documentation/git-commit.txt
index d227cec9ba566caa098c36e8c91b19a8a27fcae5,c45fbe4f9753df62299acc687f86dc672ba80860..c97c151ae1fdf53a09c5d3796ea6f6fb98b57b03
Like '-C', but with '-c' the editor is invoked, so that
the user can further edit the commit message.
---dry-run::
- Do not actually make a commit, but show the list of paths
- with updates in the index, paths with changes in the work tree,
- and paths that are untracked, similar to the one that is given
- in the commit log editor.
+--reset-author::
+ When used with -C/-c/--amend options, declare that the
+ authorship of the resulting commit now belongs of the committer.
+ This also renews the author timestamp.
+ --short::
+ When doing a dry-run, give the output in the short-format. See
+ linkgit:git-status[1] for details. Implies `--dry-run`.
+
+ --porcelain::
+ When doing a dry-run, give the output in a porcelain-ready
+ format. See linkgit:git-status[1] for details. Implies
+ `--dry-run`.
+
+ -z::
+ When showing `short` or `porcelain` status output, terminate
+ entries in the status output with NUL, instead of LF. If no
+ format is given, implies the `--porcelain` output format.
+
-F <file>::
--file=<file>::
Take the commit message from the given file. Use '-' to
diff --cc builtin-commit.c
Simple merge
diff --cc t/t4034-diff-words.sh
index 1c21276c55400c594f71bc01eba17b0d3820b420,17621dd5a412620299f53eecb7e247b3829e25c5..2e2e103b31332ea2f74de5d5e6e49c00b13dfa8a
+++ b/t/t4034-diff-words.sh
<WHITE>index 330b04f..5ed8eff 100644<RESET>
<WHITE>--- a/pre<RESET>
<WHITE>+++ b/post<RESET>
- <BROWN>@@ -1,3 +1,7 @@<RESET>
+ <CYAN>@@ -1,3 +1,7 @@<RESET>
<RED>h(4)<RESET><GREEN>h(4),hh[44]<RESET>
-<RESET>
+
a = b + c<RESET>
<GREEN>aa = a<RESET>
'
- <BROWN>@@ -1 +1 @@<RESET>
+cat > expect <<\EOF
+<WHITE>diff --git a/pre b/post<RESET>
+<WHITE>index 330b04f..5ed8eff 100644<RESET>
+<WHITE>--- a/pre<RESET>
+<WHITE>+++ b/post<RESET>
- <BROWN>@@ -3,0 +4,4 @@<RESET> <RESET><MAGENTA>a = b + c<RESET>
++<CYAN>@@ -1 +1 @@<RESET>
+<RED>h(4)<RESET><GREEN>h(4),hh[44]<RESET>
++<CYAN>@@ -3,0 +4,4 @@<RESET> <RESET><MAGENTA>a = b + c<RESET>
+
+<GREEN>aa = a<RESET>
+
+<GREEN>aeff = aeff * ( aaa )<RESET>
+EOF
+
+test_expect_success 'word diff without context' '
+
+ word_diff --color-words --unified=0
+
+'
+
cat > expect <<\EOF
<WHITE>diff --git a/pre b/post<RESET>
<WHITE>index 330b04f..5ed8eff 100644<RESET>
<WHITE>--- a/pre<RESET>
<WHITE>+++ b/post<RESET>
- <BROWN>@@ -1,3 +1,7 @@<RESET>
+ <CYAN>@@ -1,3 +1,7 @@<RESET>
h(4),<GREEN>hh<RESET>[44]
-<RESET>
+
a = b + c<RESET>
<GREEN>aa = a<RESET>
<WHITE>index 330b04f..5ed8eff 100644<RESET>
<WHITE>--- a/pre<RESET>
<WHITE>+++ b/post<RESET>
- <BROWN>@@ -1,3 +1,7 @@<RESET>
+ <CYAN>@@ -1,3 +1,7 @@<RESET>
h(4)<GREEN>,hh[44]<RESET>
-<RESET>
+
a = b + c<RESET>
<GREEN>aa = a<RESET>
<WHITE>index 330b04f..5ed8eff 100644<RESET>
<WHITE>--- a/pre<RESET>
<WHITE>+++ b/post<RESET>
- <BROWN>@@ -1,3 +1,7 @@<RESET>
+ <CYAN>@@ -1,3 +1,7 @@<RESET>
h(4),<GREEN>hh[44<RESET>]
-<RESET>
+
a = b + c<RESET>
<GREEN>aa = a<RESET>
diff --cc t/test-lib.sh
index 2d523fe0f08dbbc1971f4601f24664cdbce95415,d63ad2d870423cd28b42993bf35fa0257df654a8..142f36f2e919929520d240e56b65f2b69e4b4982
--- 1/t/test-lib.sh
--- 2/t/test-lib.sh
+++ b/t/test-lib.sh
test_set_editor () {
FAKE_EDITOR="$1"
export FAKE_EDITOR
- VISUAL='"$FAKE_EDITOR"'
- export VISUAL
+ EDITOR='"$FAKE_EDITOR"'
+ export EDITOR
}
+ test_decode_color () {
+ sed -e 's/.\[1m/<WHITE>/g' \
+ -e 's/.\[31m/<RED>/g' \
+ -e 's/.\[32m/<GREEN>/g' \
+ -e 's/.\[33m/<YELLOW>/g' \
+ -e 's/.\[34m/<BLUE>/g' \
+ -e 's/.\[35m/<MAGENTA>/g' \
+ -e 's/.\[36m/<CYAN>/g' \
+ -e 's/.\[m/<RESET>/g'
+ }
+
test_tick () {
if test -z "${test_tick+set}"
then
diff --cc wt-status.c
index 38eb24536b34e40af4c43eb1631e08624e8993d6,c4589055bb7d6b8e945477d09e0015fe2da349af..5d569880163cccec91fdf1e9d50e03a6b5314d58
--- 1/wt-status.c
--- 2/wt-status.c
+++ b/wt-status.c
static void wt_status_print_unmerged_header(struct wt_status *s)
{
const char *c = color(WT_STATUS_HEADER, s);
+
color_fprintf_ln(s->fp, c, "# Unmerged paths:");
- if (!s->is_initial)
+ if (!advice_status_hints)
+ return;
+ if (s->in_merge)
+ ;
+ else if (!s->is_initial)
color_fprintf_ln(s->fp, c, "# (use \"git reset %s <file>...\" to unstage)", s->reference);
else
color_fprintf_ln(s->fp, c, "# (use \"git rm --cached <file>...\" to unstage)");
static void wt_status_print_cached_header(struct wt_status *s)
{
const char *c = color(WT_STATUS_HEADER, s);
+
color_fprintf_ln(s->fp, c, "# Changes to be committed:");
- if (!s->is_initial) {
+ if (!advice_status_hints)
+ return;
+ if (s->in_merge)
+ ; /* NEEDSWORK: use "git reset --unresolve"??? */
+ else if (!s->is_initial)
color_fprintf_ln(s->fp, c, "# (use \"git reset %s <file>...\" to unstage)", s->reference);
- } else {
+ else
color_fprintf_ln(s->fp, c, "# (use \"git rm --cached <file>...\" to unstage)");
- }
color_fprintf_ln(s->fp, c, "#");
}
int has_deleted)
{
const char *c = color(WT_STATUS_HEADER, s);
+
color_fprintf_ln(s->fp, c, "# Changed but not updated:");
+ if (!advice_status_hints)
+ return;
if (!has_deleted)
color_fprintf_ln(s->fp, c, "# (use \"git add <file>...\" to update what will be committed)");
else