* [RFH] Mention of 1.7.0 transition plans in Release Notes to 1.6.6
@ 2009-11-28 22:46 Junio C Hamano
2009-11-29 3:24 ` Nanako Shiraishi
2009-11-29 7:24 ` Junio C Hamano
0 siblings, 2 replies; 7+ messages in thread
From: Junio C Hamano @ 2009-11-28 22:46 UTC (permalink / raw)
To: git
I am attaching the first part of the current draft release notes to
request help from the developer community, so that we can avoid a fiasco
like we had at 1.6.0 when we switched from "git-foo" to "git foo".
The 1.6.0 change was widely advertised but the way it was introduced
allowed users to _ignore_ the issue until the last minute, and as the
consequence of having ignoring the issue, they were _forced_ to scramble
and adjust once their system administrator decided to install the new
version.
I think contributors who pushed for the updated safety valve for "git
push" did a lot better, learning from the bitter 1.6.0 experience, to
prevent users from ignoring the issue and instead prepare them for smooth
transition. I wanted to make sure all the users who read Release Notes to
the upcoming release but otherwise do not follow this list regularly will
not be surprised when 1.7.0 happens, and I feel the text needs polishing
for that purpose. We might want to deliver the announcement to a wider
audience than usual as well, and volunteers to help doing so are very
welcomed.
Two things and a half to note:
- I do not think we have such an anti-procrastination measure for
send-email's --[no-]chain-reply-to change. We might want to have one
before 1.6.6 ships; namely, if the code decided to use chain-reply-to
behaviour by default because there was no sendemail.chainreplyto (or
sendemail.$identity.chainreplyto) configured, nor --no-chain-reply-to
or --chain-reply-to given from the command line, we issue a big fat
warning just like we warn against unconfigured push.denyCurrentBranch
when allowing pushing to a checked-out branch without being told.
- I do not think of a sane way to cover "diff -b/-w" changes, as this is
a "bugfix --- but there may be some scripts that have been relying on
the bug", and a configuration option that retains the buggy behaviour
does not make much sense. But I may be mistaken and somebody can come
up with an easy patch to allow both behaviour, in which case we should
add similar anti-procrastination measure to this change.
- Recent proposal to add "grep.fulltree" configuration variable may fall
into the same category as sendemail.chainreplyto, as it is not about
"buggy behaviour" nor "risky default that can easily hurt users" but is
more about "there are two competing and equally sane defaults and it is
purely an issue of user preference". So if we were to decide flip the
default in a far future, we may add such anti-procrastination measure
there as well (but not before we decide we will flip it someday).
This last item is obviously outside the scope of 1.7.0, though.
----------------------------------------------------------------
Git v1.6.6 Release Notes
========================
Notes on behaviour change
-------------------------
* In this release, "git fsck" defaults to "git fsck --full" and
checks packfiles, and because of this it will take much longer to
complete than before. If you prefer a quicker check only on loose
objects (the old default), you can say "git fsck --no-full". This
has been supported by 1.5.4 and newer versions of git, so it is
safe to write it in your script even if you use slightly older git
on some of your machines.
Preparing yourselves for compatibility issues in 1.7.0
------------------------------------------------------
In git 1.7.0, which is planned to be the release after 1.6.6, there will
be a handful of behaviour changes that will break backward compatibility.
These changes were discussed long time ago and existing behaviours have
been identified as more problematic to the userbase than keeping them for
the sake of backward compatibility.
When necessary, transition strategy for existing users has been designed
not to force them running around setting configuration variables and
updating their scripts in order to keep the traditional behaviour on the
day their sysadmin decides to install the new version of git. When we
switched from "git-foo" to "git foo" in 1.6.0, even though the change had
been advertised and the transition guide had been provided for a very long
time, the users procrastinated during the entire transtion period, and
ended up panicking on the day their sysadmins updated their git.
For changes decided to be in 1.7.0, we have been much louder to strongly
discourage such procrastination. If you have been using recent versions
of git, you would have already seen warnings issued when you exercised
features whose behaviour will change, with the instruction on how to keep
the existing behaviour if you choose to. You hopefully should be well
prepared already.
Of course, we have also given "this and that will change in 1.7.0; prepare
yourselves" warnings in the release notes and announcement messages.
Let's see how well users will fare this time.
* "git push" into a branch that is currently checked out (i.e. pointed by
HEAD in a repository that is not bare) will be refused by default.
Similarly, "git push $there :$killed" to delete the branch $killed
in a remote repository $there, when $killed branch is the current
branch pointed at by its HEAD, will be refused by default.
Setting the configuration variables receive.denyCurrentBranch and
receive.denyDeleteCurrent to 'ignore' in the receiving repository
can be used to override these safety features. Versions of git
since 1.6.2 have issued a loud warning when you tried to do them
without setting the configuration, so repositories of people who
still need to be able to perform such a push should already been
future proofed.
Please refer to:
http://git.or.cz/gitwiki/GitFaq#non-bare
http://thread.gmane.org/gmane.comp.version-control.git/107758/focus=108007
for more details on the reason why this change is needed and the
transition process that already took place so far.
* "git send-email" will not make deep threads by default when sending a
patch series with more than two messages. All messages will be sent as
a reply to the first message, i.e. cover letter. It has been possible
to configure send-email to do this by setting sendemail.chainreplyto
configuration variable to false. The only thing the new release will
do is to change the default when you haven't configured that variable.
* "git status" will not be "git commit --dry-run". This change does not
affect you if you run the command without pathspec.
Nobody sane found the current behaviour of "git status Makefile" useful
nor meaningful, and it confused users. "git commit --dry-run" has been
provided as a way to get the current behaviour of this command since
1.6.5.
* "git diff" traditionally treated various "ignore whitespace" options
only as a way to filter the patch output. "git diff --exit-code -b"
exited with non-zero status even if all changes were about changing the
ammount of whitespace and nothing else. and "git diff -b" showed the
"diff --git" header line for such a change without patch text.
In 1.7.0, the "ignore whitespaces" will affect the semantics of the
diff operation itself. A change that does not affect anything but
whitespaces will be reported with zero exit status when run with
--exit-code, and there will not be "diff --git" header for such a
change.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFH] Mention of 1.7.0 transition plans in Release Notes to 1.6.6
2009-11-28 22:46 [RFH] Mention of 1.7.0 transition plans in Release Notes to 1.6.6 Junio C Hamano
@ 2009-11-29 3:24 ` Nanako Shiraishi
2009-11-29 8:44 ` Junio C Hamano
2009-11-29 7:24 ` Junio C Hamano
1 sibling, 1 reply; 7+ messages in thread
From: Nanako Shiraishi @ 2009-11-29 3:24 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Michael Witten, Jay Soffian
Subject: prepare send-email for smoother change of --chain-reply-to default
Give a warning message when send-email uses chain-reply-to to thread the
messages because of the current default, not because the user explicitly
asked to, either from the command line or from the configuration.
This way, by the time 1.7.0 switches the default, everybody will be ready.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
---
Quoting Junio C Hamano <gitster@pobox.com>
> - I do not think we have such an anti-procrastination measure for
> send-email's --[no-]chain-reply-to change. We might want to have one
> before 1.6.6 ships; namely, if the code decided to use chain-reply-to
> behaviour by default because there was no sendemail.chainreplyto (or
> sendemail.$identity.chainreplyto) configured, nor --no-chain-reply-to
> or --chain-reply-to given from the command line, we issue a big fat
> warning just like we warn against unconfigured push.denyCurrentBranch
> when allowing pushing to a checked-out branch without being told.
Like this?
git-send-email.perl | 19 +++++++++++++++++--
t/t9001-send-email.sh | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 4f5da4e..2afed76 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -187,9 +187,11 @@ my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);
my ($validate, $confirm);
my (@suppress_cc);
+my $not_set_by_user = "true but not set by the user";
+
my %config_bool_settings = (
"thread" => [\$thread, 1],
- "chainreplyto" => [\$chain_reply_to, 1],
+ "chainreplyto" => [\$chain_reply_to, $not_set_by_user],
"suppressfrom" => [\$suppress_from, undef],
"signedoffbycc" => [\$signed_off_by_cc, undef],
"signedoffcc" => [\$signed_off_by_cc, undef], # Deprecated
@@ -214,6 +216,19 @@ my %config_settings = (
"from" => \$sender,
);
+# Help users prepare for 1.7.0
+sub chain_reply_to {
+ if (defined $chain_reply_to &&
+ $chain_reply_to eq $not_set_by_user) {
+ print STDERR
+ "In git 1.7.0, the default will be changed to --no-chain-reply-to\n" .
+ "Set sendemail.chainreplyto configuration variable to true if\n" .
+ "you want to keep --chain-reply-to as your default.\n";
+ $chain_reply_to = 1;
+ }
+ return $chain_reply_to;
+}
+
# Handle Uncouth Termination
sub signal_handler {
@@ -1157,7 +1172,7 @@ foreach my $t (@files) {
# set up for the next message
if ($thread && $message_was_sent &&
- ($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
+ (chain_reply_to() || !defined $reply_to || length($reply_to) == 0)) {
$reply_to = $message_id;
if (length $references > 0) {
$references .= "\n $message_id";
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 84a7f03..4372774 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -769,4 +769,44 @@ test_expect_success 'threading but no chain-reply-to' '
grep "In-Reply-To: " stdout
'
+test_expect_success 'no warning with an explicit --chain-reply-to' '
+ git send-email \
+ --dry-run \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --chain-reply-to \
+ outdir/000?-*.patch 2>errors >out &&
+ ! grep "no-chain-reply-to" errors
+'
+
+test_expect_success 'no warning with an explicit --no-chain-reply-to' '
+ git send-email \
+ --dry-run \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --no-chain-reply-to \
+ outdir/000?-*.patch 2>errors >out &&
+ ! grep "no-chain-reply-to" errors
+'
+
+test_expect_success 'no warning with sendemail.chainreplyto = false' '
+ git config sendemail.chainreplyto false &&
+ git send-email \
+ --dry-run \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ outdir/000?-*.patch 2>errors >out &&
+ ! grep "no-chain-reply-to" errors
+'
+
+test_expect_success 'no warning with sendemail.chainreplyto = true' '
+ git config sendemail.chainreplyto true &&
+ git send-email \
+ --dry-run \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ outdir/000?-*.patch 2>errors >out &&
+ ! grep "no-chain-reply-to" errors
+'
+
test_done
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFH] Mention of 1.7.0 transition plans in Release Notes to 1.6.6
2009-11-28 22:46 [RFH] Mention of 1.7.0 transition plans in Release Notes to 1.6.6 Junio C Hamano
2009-11-29 3:24 ` Nanako Shiraishi
@ 2009-11-29 7:24 ` Junio C Hamano
2009-11-29 7:25 ` [PATCH 1/3] diff: flip the default diff.bwoutputonly to true Junio C Hamano
` (2 more replies)
1 sibling, 3 replies; 7+ messages in thread
From: Junio C Hamano @ 2009-11-29 7:24 UTC (permalink / raw)
To: git
Junio C Hamano <gitster@pobox.com> writes:
> - I do not think of a sane way to cover "diff -b/-w" changes, as this is
> a "bugfix --- but there may be some scripts that have been relying on
> the bug", and a configuration option that retains the buggy behaviour
> does not make much sense. But I may be mistaken and somebody can come
> up with an easy patch to allow both behaviour, in which case we should
> add similar anti-procrastination measure to this change.
The patch to enable/disable this feature would look like the attached,
which doesn't look too bad. This apply to a merge between two topics:
jc/1.7.0-diff-whitespace-only-status (97bf2a0)
gb/1.7.0-diff-whitespace-only-output (3e97c7c)
An anti-procrastination measure must be done in at least two, but probably
in three steps on top of this patch:
#1. Flip the default in this patch back to 1, as the traditional
behaviour is to treat ignore-whitespace options as purely affecting
output of patch text, not affecting status nor the header;
#2. Add extra logic to detect if a particular invocation may trigger a
different behaviour once the default is changed to 0, and issue an
warning if there is no configuration explicitly set;
#3. Flip the default to 0, perhaps still keeping the warning when there
is no configuration.
Make a major release after the second step is done, and wait for at least
one but preferrably two releases, and then ship the result of the third
step in the "flag day" release. In a much later version we would remove
the "no configuration warning".
Do we need an anti-procrastination measure for this? If so, I think we
probably need to postpone the "diff" semantics changes after 1.7.0, as I
am not very confident that we can solidly finish the second step before
the 1.6.6 final.
Also, I am not very keen on having this configuration, as its only purpose
is to ask for a broken semantics from "diff", even though it has been the
traditional behaviour for the past four years.
Comments?
---
diff.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index da90e6e..6e7c47c 100644
--- a/diff.c
+++ b/diff.c
@@ -29,6 +29,7 @@ static const char *diff_word_regex_cfg;
static const char *external_diff_cmd_cfg;
int diff_auto_refresh_index = 1;
static int diff_mnemonic_prefix;
+static int diff_b_w_output_only;
static char diff_colors[][COLOR_MAXLEN] = {
GIT_COLOR_RESET,
@@ -133,6 +134,11 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
return 0;
}
+ if (!strcmp(var, "diff.bwoutputonly")) {
+ diff_b_w_output_only = git_config_bool(var, value);
+ return 0;
+ }
+
return git_color_default_config(var, value, cb);
}
@@ -1668,7 +1674,7 @@ static void builtin_diff(const char *name_a,
struct emit_callback ecbdata;
const struct userdiff_funcname *pe;
- if (!DIFF_XDL_TST(o, WHITESPACE_FLAGS)) {
+ if (!DIFF_XDL_TST(o, WHITESPACE_FLAGS) || diff_b_w_output_only) {
fprintf(o->file, "%s", header.buf);
strbuf_reset(&header);
}
@@ -2537,9 +2543,10 @@ int diff_setup_done(struct diff_options *options)
* inside contents.
*/
- if (DIFF_XDL_TST(options, IGNORE_WHITESPACE) ||
- DIFF_XDL_TST(options, IGNORE_WHITESPACE_CHANGE) ||
- DIFF_XDL_TST(options, IGNORE_WHITESPACE_AT_EOL))
+ if (!diff_b_w_output_only &&
+ (DIFF_XDL_TST(options, IGNORE_WHITESPACE) ||
+ DIFF_XDL_TST(options, IGNORE_WHITESPACE_CHANGE) ||
+ DIFF_XDL_TST(options, IGNORE_WHITESPACE_AT_EOL)))
DIFF_OPT_SET(options, DIFF_FROM_CONTENTS);
else
DIFF_OPT_CLR(options, DIFF_FROM_CONTENTS);
--
1.6.6.rc0.61.g41d5b.dirty
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/3] diff: flip the default diff.bwoutputonly to true
2009-11-29 7:24 ` Junio C Hamano
@ 2009-11-29 7:25 ` Junio C Hamano
2009-11-29 7:25 ` [PATCH 2/3] diff: flip the diff.bwoutputonly default to false Junio C Hamano
2009-11-29 7:26 ` [PATCH 3/3] diff: disable diff.bwoutputonly warning Junio C Hamano
2 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2009-11-29 7:25 UTC (permalink / raw)
To: git
This switches the default behaviour of "diff -w/-b" back to the
traditional "ignore whitespace affects only output of patch text, not
status nor diff header", and allows the planned new semantics to be asked
in advance by setting diff.bwoutputonly configuration to false.
Also a loud warning is issued when the configuration is not set at all,
so that we can flip the default later more smoothly.
Update tests to check cases where the configuration is set to true, false
and not set at all; make sure the warning is issued when and only when
necessary.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
diff.c | 23 ++++++++++---
t/t4015-diff-whitespace.sh | 70 +++++++++++++++++++++++++++++++++---------
t/t4040-whitespace-status.sh | 48 ++++++++++++++++++----------
3 files changed, 103 insertions(+), 38 deletions(-)
diff --git a/diff.c b/diff.c
index 6e7c47c..fb93a22 100644
--- a/diff.c
+++ b/diff.c
@@ -29,7 +29,8 @@ static const char *diff_word_regex_cfg;
static const char *external_diff_cmd_cfg;
int diff_auto_refresh_index = 1;
static int diff_mnemonic_prefix;
-static int diff_b_w_output_only;
+static int diff_b_w_output_only = 1;
+static int diff_b_w_output_only_given;
static char diff_colors[][COLOR_MAXLEN] = {
GIT_COLOR_RESET,
@@ -135,6 +136,7 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "diff.bwoutputonly")) {
+ diff_b_w_output_only_given = 1;
diff_b_w_output_only = git_config_bool(var, value);
return 0;
}
@@ -2521,9 +2523,15 @@ void diff_setup(struct diff_options *options)
}
}
+static const char *bw_option_warning =
+ "ignore-whitespace options will stop showing diff headers in later\n"
+ "versions of git; set diff.bwoutputonly to true to keep the old\n"
+ "behaviour, or set.bwoutputonly to false to squelch this message.\n";
+
int diff_setup_done(struct diff_options *options)
{
int count = 0;
+ int bw_options;
if (options->output_format & DIFF_FORMAT_NAME)
count++;
@@ -2542,11 +2550,14 @@ int diff_setup_done(struct diff_options *options)
* --ignore-whitespace* options force us to look
* inside contents.
*/
-
- if (!diff_b_w_output_only &&
- (DIFF_XDL_TST(options, IGNORE_WHITESPACE) ||
- DIFF_XDL_TST(options, IGNORE_WHITESPACE_CHANGE) ||
- DIFF_XDL_TST(options, IGNORE_WHITESPACE_AT_EOL)))
+ bw_options = (DIFF_XDL_TST(options, IGNORE_WHITESPACE) ||
+ DIFF_XDL_TST(options, IGNORE_WHITESPACE_CHANGE) ||
+ DIFF_XDL_TST(options, IGNORE_WHITESPACE_AT_EOL));
+ if (!diff_b_w_output_only_given && bw_options && bw_option_warning) {
+ warning("%s", bw_option_warning);
+ bw_option_warning = NULL;
+ }
+ if (!diff_b_w_output_only && bw_options)
DIFF_OPT_SET(options, DIFF_FROM_CONTENTS);
else
DIFF_OPT_CLR(options, DIFF_FROM_CONTENTS);
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 90f3342..310421b 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -92,16 +92,30 @@ EOF
git diff > out
test_expect_success 'another test, without options' 'test_cmp expect out'
-cat << EOF > expect
+test_w_b () {
+ note=$1
+ for o in "-w" "-w -b" "-w --ignore-space-at-eol" "-w -b --ignore-space-at-eol"
+ do
+ test_expect_success "with $o ($note)" '
+ git diff $o >actual &&
+ test_cmp expect actual
+ '
+ done
+}
+
+git config diff.bwoutputonly false
+> expect
+test_w_b "bwoutputonly=false"
+
+git config diff.bwoutputonly true
+cat <<EOF >expect
+diff --git a/x b/x
+index d99af23..8b32fb5 100644
EOF
-git diff -w > out
-test_expect_success 'another test, with -w' 'test_cmp expect out'
-git diff -w -b > out
-test_expect_success 'another test, with -w -b' 'test_cmp expect out'
-git diff -w --ignore-space-at-eol > out
-test_expect_success 'another test, with -w --ignore-space-at-eol' 'test_cmp expect out'
-git diff -w -b --ignore-space-at-eol > out
-test_expect_success 'another test, with -w -b --ignore-space-at-eol' 'test_cmp expect out'
+test_w_b "bwoutputonly=true"
+
+git config --unset diff.bwoutputonly
+test_w_b "bwoutputonly unset"
tr 'Q' '\015' << EOF > expect
diff --git a/x b/x
@@ -384,20 +398,47 @@ test_expect_success 'checkdiff allows new blank lines' '
git diff --check
'
-cat <<EOF >expect
-EOF
-test_expect_success 'whitespace-only changes not reported' '
+test_expect_success 'whitespace-only changes shown' '
+ git config --unset diff.bwoutputonly
git reset --hard &&
echo >x "hello world" &&
git add x &&
git commit -m "hello 1" &&
echo >x "hello world" &&
git diff -b >actual &&
- test_cmp expect actual
+ test 2 = $(wc -l <actual)
'
-test_expect_success 'combined diff with autocrlf conversion' '
+test_expect_success 'whitespace-only changes shown with diff.bwoutputonly' '
+ git config diff.bwoutputonly true &&
+ git diff -b >actual &&
+ test 2 = $(wc -l <actual)
+'
+
+test_expect_success 'whitespace-only changes hidden with !diff.bwoutputonly' '
+ git config diff.bwoutputonly false &&
+ git diff -b >actual &&
+ ! test -s actual
+'
+
+test_expect_success 'no warning with diff.bwoutputonly given' '
+ git diff -b 2>errors &&
+ ! grep warn errors
+'
+test_expect_success 'no warning without diff.bwoutputonly' '
+ git config --unset diff.bwoutputonly
+ git diff -p 2>errors &&
+ ! grep "stop showing" errors
+'
+
+test_expect_success 'warning without diff.bwoutputonly' '
+ git config --unset diff.bwoutputonly
+ git diff -b 2>errors &&
+ grep "stop showing" errors
+'
+
+test_expect_success 'combined diff with autocrlf conversion' '
git reset --hard &&
echo >x hello &&
git commit -m "one side" x &&
@@ -409,7 +450,6 @@ test_expect_success 'combined diff with autocrlf conversion' '
git diff | sed -e "1,/^@@@/d" >actual &&
! grep "^-" actual
-
'
test_done
diff --git a/t/t4040-whitespace-status.sh b/t/t4040-whitespace-status.sh
index a30b03b..95a93f7 100755
--- a/t/t4040-whitespace-status.sh
+++ b/t/t4040-whitespace-status.sh
@@ -19,45 +19,59 @@ test_expect_success setup '
git add a/d
'
-test_expect_success 'diff-tree --exit-code' '
+test_once () {
+ note=$1 tmf=$2
+
+test_expect_success "diff-tree --exit-code ($note)" '
test_must_fail git diff --exit-code HEAD^ HEAD &&
test_must_fail git diff-tree --exit-code HEAD^ HEAD
'
-test_expect_success 'diff-tree -b --exit-code' '
- git diff -b --exit-code HEAD^ HEAD &&
- git diff-tree -b -p --exit-code HEAD^ HEAD &&
- git diff-tree -b --exit-code HEAD^ HEAD
+test_expect_success "diff-tree -b --exit-code ($note)" '
+ $tmf git diff -b --exit-code HEAD^ HEAD &&
+ $tmf git diff-tree -b -p --exit-code HEAD^ HEAD &&
+ $tmf git diff-tree -b --exit-code HEAD^ HEAD
'
-test_expect_success 'diff-index --cached --exit-code' '
+test_expect_success "diff-index --cached --exit-code ($note)" '
test_must_fail git diff --cached --exit-code HEAD &&
test_must_fail git diff-index --cached --exit-code HEAD
'
-test_expect_success 'diff-index -b -p --cached --exit-code' '
- git diff -b --cached --exit-code HEAD &&
- git diff-index -b -p --cached --exit-code HEAD
+test_expect_success "diff-index -b -p --cached --exit-code ($note)" '
+ $tmf git diff -b --cached --exit-code HEAD &&
+ $tmf git diff-index -b -p --cached --exit-code HEAD
'
-test_expect_success 'diff-index --exit-code' '
+test_expect_success "diff-index --exit-code ($note)" '
test_must_fail git diff --exit-code HEAD &&
test_must_fail git diff-index --exit-code HEAD
'
-test_expect_success 'diff-index -b -p --exit-code' '
- git diff -b --exit-code HEAD &&
- git diff-index -b -p --exit-code HEAD
+test_expect_success "diff-index -b -p --exit-code ($note)" '
+ $tmf git diff -b --exit-code HEAD &&
+ $tmf git diff-index -b -p --exit-code HEAD
'
-test_expect_success 'diff-files --exit-code' '
+test_expect_success "diff-files --exit-code ($note)" '
test_must_fail git diff --exit-code &&
test_must_fail git diff-files --exit-code
'
-test_expect_success 'diff-files -b -p --exit-code' '
- git diff -b --exit-code &&
- git diff-files -b -p --exit-code
+test_expect_success "diff-files -b -p --exit-code ($note)" '
+ $tmf git diff -b --exit-code &&
+ $tmf git diff-files -b -p --exit-code
'
+}
+
+git config diff.bwoutputonly true
+test_once "bwoutputonly=true" "test_must_fail"
+
+git config diff.bwoutputonly false
+test_once "bwoutputonly=false" ""
+
+git config --unset diff.bwoutputonly
+test_once "bwoutputonly unset" "test_must_fail"
+
test_done
--
1.6.6.rc0.61.g41d5b.dirty
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] diff: flip the diff.bwoutputonly default to false
2009-11-29 7:24 ` Junio C Hamano
2009-11-29 7:25 ` [PATCH 1/3] diff: flip the default diff.bwoutputonly to true Junio C Hamano
@ 2009-11-29 7:25 ` Junio C Hamano
2009-11-29 7:26 ` [PATCH 3/3] diff: disable diff.bwoutputonly warning Junio C Hamano
2 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2009-11-29 7:25 UTC (permalink / raw)
To: git
This finally corrects the broken "ignore whitespace options only
affect patch output and never affects status nor header output",
as we have been planning for 1.7.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
diff.c | 2 +-
t/t4015-diff-whitespace.sh | 5 +++--
t/t4040-whitespace-status.sh | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index fb93a22..df67f18 100644
--- a/diff.c
+++ b/diff.c
@@ -29,7 +29,7 @@ static const char *diff_word_regex_cfg;
static const char *external_diff_cmd_cfg;
int diff_auto_refresh_index = 1;
static int diff_mnemonic_prefix;
-static int diff_b_w_output_only = 1;
+static int diff_b_w_output_only;
static int diff_b_w_output_only_given;
static char diff_colors[][COLOR_MAXLEN] = {
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 310421b..8ca81e8 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -114,6 +114,7 @@ index d99af23..8b32fb5 100644
EOF
test_w_b "bwoutputonly=true"
+>expect
git config --unset diff.bwoutputonly
test_w_b "bwoutputonly unset"
@@ -398,7 +399,7 @@ test_expect_success 'checkdiff allows new blank lines' '
git diff --check
'
-test_expect_success 'whitespace-only changes shown' '
+test_expect_success 'whitespace-only changes hidden' '
git config --unset diff.bwoutputonly
git reset --hard &&
echo >x "hello world" &&
@@ -406,7 +407,7 @@ test_expect_success 'whitespace-only changes shown' '
git commit -m "hello 1" &&
echo >x "hello world" &&
git diff -b >actual &&
- test 2 = $(wc -l <actual)
+ ! test -s actual
'
test_expect_success 'whitespace-only changes shown with diff.bwoutputonly' '
diff --git a/t/t4040-whitespace-status.sh b/t/t4040-whitespace-status.sh
index 95a93f7..57db3cc 100755
--- a/t/t4040-whitespace-status.sh
+++ b/t/t4040-whitespace-status.sh
@@ -72,6 +72,6 @@ git config diff.bwoutputonly false
test_once "bwoutputonly=false" ""
git config --unset diff.bwoutputonly
-test_once "bwoutputonly unset" "test_must_fail"
+test_once "bwoutputonly unset" ""
test_done
--
1.6.6.rc0.61.g41d5b.dirty
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] diff: disable diff.bwoutputonly warning
2009-11-29 7:24 ` Junio C Hamano
2009-11-29 7:25 ` [PATCH 1/3] diff: flip the default diff.bwoutputonly to true Junio C Hamano
2009-11-29 7:25 ` [PATCH 2/3] diff: flip the diff.bwoutputonly default to false Junio C Hamano
@ 2009-11-29 7:26 ` Junio C Hamano
2 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2009-11-29 7:26 UTC (permalink / raw)
To: git
After 1.7.0 (or whatever version) ships and everybody expects the new
semantics from "diff", we can squelch the warning.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
diff.c | 11 -----------
t/t4015-diff-whitespace.sh | 4 ++--
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/diff.c b/diff.c
index df67f18..ba1f482 100644
--- a/diff.c
+++ b/diff.c
@@ -30,7 +30,6 @@ static const char *external_diff_cmd_cfg;
int diff_auto_refresh_index = 1;
static int diff_mnemonic_prefix;
static int diff_b_w_output_only;
-static int diff_b_w_output_only_given;
static char diff_colors[][COLOR_MAXLEN] = {
GIT_COLOR_RESET,
@@ -136,7 +135,6 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
}
if (!strcmp(var, "diff.bwoutputonly")) {
- diff_b_w_output_only_given = 1;
diff_b_w_output_only = git_config_bool(var, value);
return 0;
}
@@ -2523,11 +2521,6 @@ void diff_setup(struct diff_options *options)
}
}
-static const char *bw_option_warning =
- "ignore-whitespace options will stop showing diff headers in later\n"
- "versions of git; set diff.bwoutputonly to true to keep the old\n"
- "behaviour, or set.bwoutputonly to false to squelch this message.\n";
-
int diff_setup_done(struct diff_options *options)
{
int count = 0;
@@ -2553,10 +2546,6 @@ int diff_setup_done(struct diff_options *options)
bw_options = (DIFF_XDL_TST(options, IGNORE_WHITESPACE) ||
DIFF_XDL_TST(options, IGNORE_WHITESPACE_CHANGE) ||
DIFF_XDL_TST(options, IGNORE_WHITESPACE_AT_EOL));
- if (!diff_b_w_output_only_given && bw_options && bw_option_warning) {
- warning("%s", bw_option_warning);
- bw_option_warning = NULL;
- }
if (!diff_b_w_output_only && bw_options)
DIFF_OPT_SET(options, DIFF_FROM_CONTENTS);
else
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index 8ca81e8..0964ea2 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -433,10 +433,10 @@ test_expect_success 'no warning without diff.bwoutputonly' '
! grep "stop showing" errors
'
-test_expect_success 'warning without diff.bwoutputonly' '
+test_expect_success 'no warning anymore' '
git config --unset diff.bwoutputonly
git diff -b 2>errors &&
- grep "stop showing" errors
+ ! grep "stop showing" errors
'
test_expect_success 'combined diff with autocrlf conversion' '
--
1.6.6.rc0.61.g41d5b.dirty
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [RFH] Mention of 1.7.0 transition plans in Release Notes to 1.6.6
2009-11-29 3:24 ` Nanako Shiraishi
@ 2009-11-29 8:44 ` Junio C Hamano
0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2009-11-29 8:44 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: git, Michael Witten, Jay Soffian
Nanako Shiraishi <nanako3@lavabit.com> writes:
> Subject: prepare send-email for smoother change of --chain-reply-to default
>
> Give a warning message when send-email uses chain-reply-to to thread the
> messages because of the current default, not because the user explicitly
> asked to, either from the command line or from the configuration.
>
> This way, by the time 1.7.0 switches the default, everybody will be ready.
>
> Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
> ---
Looks good.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-11-29 8:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-28 22:46 [RFH] Mention of 1.7.0 transition plans in Release Notes to 1.6.6 Junio C Hamano
2009-11-29 3:24 ` Nanako Shiraishi
2009-11-29 8:44 ` Junio C Hamano
2009-11-29 7:24 ` Junio C Hamano
2009-11-29 7:25 ` [PATCH 1/3] diff: flip the default diff.bwoutputonly to true Junio C Hamano
2009-11-29 7:25 ` [PATCH 2/3] diff: flip the diff.bwoutputonly default to false Junio C Hamano
2009-11-29 7:26 ` [PATCH 3/3] diff: disable diff.bwoutputonly warning Junio C Hamano
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 NNTP newsgroup(s).