git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Duy Nguyen <pclouds@gmail.com>
Date
May 12, 2013, 10:23 UTC
Message-ID
<CACsJy8A+vjtwnB0LStVS3Q9v2JaKcMDa0sATr9H==X3EhQt6Jg@mail.gmail.com>
In-Reply-To
<20130511201928.GA22938@book.hvoigt.net>
On Sun, May 12, 2013 at 3:20 AM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
Show 8 quoted lines
> 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@hvoigt.net>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
> Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
> Signed-off-by: Johan Herland <johan@herland.net>
A product of Git Berlin Meetup?
Show 23 quoted lines
> +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!
Show 9 quoted lines
> +
> +       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

Previous: Ramkumar RamachandraNext: Heiko Voigt
Message 3 of 9 in “teach the user to be nice to git and let him say please sometimes”
  1. teach the user to be nice to git and let him say please sometimesHeiko Voigt, May 11, 2013
  2. Ramkumar RamachandraMay 12, 2013
  3. Duy NguyenMay 12, 2013
  4. Heiko VoigtMay 13, 2013
  5. Duy NguyenMay 13, 2013
  6. Junio C HamanoMay 12, 2013
  7. Heiko VoigtMay 13, 2013
  8. Thomas RastMay 13, 2013
  9. Junio C HamanoMay 13, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.