Re: [PATCH] teach the user to be nice to git and let him say please sometimes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 12, 2013 at 3:20 AM, Heiko Voigt <hvoigt@xxxxxxxxxx> wrote:
> Since ages we do not care about our program enough. Lets not treat them
> as slaves anymore and say please.
>
> Signed-off-by: Heiko Voigt <hvoigt@xxxxxxxxxx>
> Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
> Signed-off-by: Jens Lehmann <Jens.Lehmann@xxxxxx>
> Signed-off-by: Thomas Rast <trast@xxxxxxxxxxx>
> Signed-off-by: Johan Herland <johan@xxxxxxxxxxx>

A product of Git Berlin Meetup?

> +static void check_politeness(const char *cmd)
> +{
> +       const char *user_config;
> +       struct strbuf buf = STRBUF_INIT;
> +
> +       if (getenv("GIT_POLITENESS_CHECK_PASSED"))
> +               return;
> +
> +       setenv("GIT_POLITENESS_CHECK_PASSED", "Yes", 1);
> +
> +       git_config_early(read_polite_counter, NULL, NULL);
> +       if (!strcmp(cmd, "please")) {
> +               impolite_counter = 0;
> +               polite_counter++;
> +       } else {
> +               impolite_counter++;
> +               polite_counter = 0;
> +       }
> +
> +       if (impolite_counter > 10)
> +               die("Error: Learn some manners, say please some time!");
> +       if (polite_counter > 10)
> +               die("Error: Too many please! I don't believe you.");

NAK. If we truly care, we need better AI here!

> +
> +       user_config = git_user_config();
> +       strbuf_addf(&buf, "%d", polite_counter);
> +       git_config_set_in_file(user_config, "user.polite", buf.buf);
> +       strbuf_reset(&buf);
> +       strbuf_addf(&buf, "%d", impolite_counter);
> +       git_config_set_in_file(user_config, "user.impolite", buf.buf);
> +       strbuf_release(&buf);
> +}
--
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]