On Fri, Oct 11, 2013 at 7:50 PM, Jeff King <p...@peff.net> wrote:
> On Fri, Oct 11, 2013 at 06:56:23PM -0500, Felipe Contreras wrote:
>> > >>> > These deprecation warning messages should be written to stderr, and
>> > >>> > should probably be prefixed with "WARNING: ".
>> > >>>
>> > >>> Is there any deprecation warning that works this way?
>> > >>
>> > >> The ones in C code typically use warning(), which will prefix with
>> > >> "warning:" and write to stderr. They do not use all-caps, though.
>> > >>
>> > >> Try "git log --grep=deprecate -Swarning" for some examples.
>> > >
>> > > I'm asking about the ones in shell, because this is a shell script.
>> > No user cares whether "git pull" is written in shell. shell Vs C is an
>> > implementation detail, stdout Vs stderr is user-visible.
>> You are free to go ahead and implement 'warning ()' in git-sh-setup.sh, in
>> meantime no shell script does that, and that's no reason to reject this patch
> You are completely missing Matthieu's point that we attempt to be
> consistent in the format of messages, as well as where they are output,
> and from a user's perspective it does not matter what language the tool
> is implemented in.
If we truly did that, there should be a warning () function, like in C.
> Also, you are wrong that there are no other shell scripts that behave as
> Richard said:
> $ git grep '>&2' | grep -i deprecate
> contrib/completion/git-completion.bash: echo "WARNING: this script is
> deprecated, please see git-completion.zsh" 1>&2
> contrib/examples/git-resolve.sh:echo 'WARNING: This command is DEPRECATED
> and will be removed very soon.' >&2
> git-lost-found.sh:echo "WARNING: '$0' is deprecated in favor of 'git fsck
> --lost-found'" >&2
> Please, can we just squash in the patch below and stop talking about
> diff --git a/git-pull.sh b/git-pull.sh
> index a9cf7ac..9c4091c 100755
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -58,8 +58,8 @@ then
> if test "$rebase" = 'true'
> - echo "The configurations pull.rebase and branch.<name>.rebase
> are deprecated."
> - echo "Please use pull.mode and branch.<name>.pullmode
> + echo >&2 "warning: The configurations pull.rebase and
> branch.<name>.rebase are deprecated."
> + echo >&2 "Please use pull.mode and branch.<name>.pullmode
> test -z "$mode" && mode=merge
Are you sure you want me to squash that in? Because the warnings
wouldn't be consistent. Some would be "WARNING: " and others would be
"warning: ". Personally I don't care, but if your argument is
consistency, you should. If we had a warning () function, we could
truly be consistent.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html