{"thread":{"id":"21413","subject":"[PATCH 0/3] increase user-friendliness","startedAt":"2009-10-29T00:22:29Z","lastAt":"2009-10-30T18:29:17Z","messageCount":9,"participants":["Jeff King","Michael Witten","A Large Angry SCM","Johannes Schindelin","Paolo Bonzini"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"126221","messageId":"20091029002229.GA986@sigill.intra.peff.net","threadId":"21413","inReplyTo":null,"subject":"[PATCH 0/3] increase user-friendliness","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-29T00:22:29Z","receivedAt":"2009-10-29T00:22:29Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Git has a reputation as being unfriendly to users. Let's fix that by\nadding some features implemented by more user-friendly programs.\n\n-Peff\n"},{"id":"126222","messageId":"20091029002400.GA1057@sigill.intra.peff.net","threadId":"21413","inReplyTo":"20091029002229.GA986@sigill.intra.peff.net","subject":"[PATCH 1/3] add splash screen","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-29T00:24:00Z","receivedAt":"2009-10-29T00:24:00Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Because bash completion is so slow to start, we need to\nentertain users with a splash screen, so reuse the one from\ngit-gui.\n\nSigned-off-by: Sverre Rabbelier <srabbelier@gmail.com>\nSigned-off-by: Sam Vilain <sam@vilain.net>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\nSigned-off-by: Nick Edelen <sirnot@gmail.com>\nSigned-off-by: \"J.H.\" <warthog9@kernel.org>\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n .gitignore    |    1 +\n Makefile      |    3 +++\n git-splash.sh |    4 ++++\n git.c         |    6 ++++++\n 4 files changed, 14 insertions(+), 0 deletions(-)\n create mode 100644 git-splash.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex 51a37b1..1e547e7 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -190,3 +190,4 @@ cscope*\n *.pdb\n Debug/\n Release/\n+git-splash\ndiff --git a/Makefile b/Makefile\nindex fea237b..36e1a61 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -329,6 +329,7 @@ SCRIPT_SH += git-rebase.sh\n SCRIPT_SH += git-repack.sh\n SCRIPT_SH += git-request-pull.sh\n SCRIPT_SH += git-sh-setup.sh\n+SCRIPT_SH += git-splash.sh\n SCRIPT_SH += git-stash.sh\n SCRIPT_SH += git-submodule.sh\n SCRIPT_SH += git-web--browse.sh\n@@ -1352,6 +1353,7 @@ gitexecdir_SQ = $(subst ','\\'',$(gitexecdir))\n template_dir_SQ = $(subst ','\\'',$(template_dir))\n htmldir_SQ = $(subst ','\\'',$(htmldir))\n prefix_SQ = $(subst ','\\'',$(prefix))\n+sharedir_SQ = $(subst ','\\'',$(sharedir))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n@@ -1428,6 +1430,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n \t    -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n+\t    -e 's|@@SHAREDIR@@|$(sharedir_SQ)|' \\\n \t    -e $(BROKEN_PATH_FIX) \\\n \t    $@.sh >$@+ && \\\n \tchmod +x $@+ && \\\ndiff --git a/git-splash.sh b/git-splash.sh\nnew file mode 100644\nindex 0000000..fc2e6f7\n--- /dev/null\n+++ b/git-splash.sh\n@@ -0,0 +1,4 @@\n+#!/bin/sh\n+\n+echo 'source @@SHAREDIR@@/git-gui/lib/logo.tcl; pack [git_logo .logo]; after 3000 exit' |\n+wish\ndiff --git a/git.c b/git.c\nindex 9883009..86dcfee 100644\n--- a/git.c\n+++ b/git.c\n@@ -459,6 +459,12 @@ int main(int argc, const char **argv)\n \tif (!cmd)\n \t\tcmd = \"git-help\";\n \n+\tif (!getenv(\"GIT_NOSPLASH\") && !(argv[1] && !strcmp(argv[1], \"splash\"))) {\n+\t\tconst char *a[] = { \"splash\", NULL };\n+\t\tconst char *e[] = { \"GIT_NOSPLASH=1\", NULL };\n+\t\trun_command_v_opt_cd_env(a, RUN_GIT_CMD, NULL, e);\n+\t}\n+\n \t/*\n \t * \"git-xxxx\" is the same as \"git xxxx\", but we obviously:\n \t *\n-- \n1.6.5.1.3.g9d77a\n"},{"id":"126223","messageId":"20091029002411.GB1057@sigill.intra.peff.net","threadId":"21413","inReplyTo":"20091029002229.GA986@sigill.intra.peff.net","subject":"[PATCH 2/3] add config-mak git command","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-29T00:24:11Z","receivedAt":"2009-10-29T00:24:11Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This records the contents of your config.mak at build time\nand prints them later.\n\nSigned-off-by: Sverre Rabbelier <srabbelier@gmail.com>\nSigned-off-by: Sam Vilain <sam@vilain.net>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\nSigned-off-by: Nick Edelen <sirnot@gmail.com>\nSigned-off-by: \"J.H.\" <warthog9@kernel.org>\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n .gitignore |    1 +\n Makefile   |    8 ++++++++\n builtin.h  |    1 +\n git.c      |    1 +\n help.c     |    7 +++++++\n 5 files changed, 18 insertions(+), 0 deletions(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex 1e547e7..cf0d8b9 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -191,3 +191,4 @@ cscope*\n Debug/\n Release/\n git-splash\n+config-mak.c\ndiff --git a/Makefile b/Makefile\nindex 36e1a61..ae4b9fc 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -480,6 +480,7 @@ LIB_OBJS += color.o\n LIB_OBJS += combine-diff.o\n LIB_OBJS += commit.o\n LIB_OBJS += config.o\n+LIB_OBJS += config-mak.o\n LIB_OBJS += connect.o\n LIB_OBJS += convert.o\n LIB_OBJS += copy.o\n@@ -1931,6 +1932,13 @@ coverage-clean:\n COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs\n COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov\n \n+config-mak.c: config.mak\n+\t(echo 'const char *config_mak ='; \\\n+\t sed < config.mak -e 's/\\\\/\\\\\\\\/g; s/\"/\\\\\"/g; s/^/\"/; s/$$/\\\\n\"/'; \\\n+\t echo ';' \\\n+\t) >$@+\n+\tmv $@+ $@\n+\n coverage-build: coverage-clean\n \t$(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" all\n \t$(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" \\\ndiff --git a/builtin.h b/builtin.h\nindex a2174dc..2ac8f3a 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -113,5 +113,6 @@ extern int cmd_verify_pack(int argc, const char **argv, const char *prefix);\n extern int cmd_show_ref(int argc, const char **argv, const char *prefix);\n extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);\n extern int cmd_replace(int argc, const char **argv, const char *prefix);\n+extern int cmd_config_mak(int argc, const char **argv, const char *prefix);\n \n #endif\ndiff --git a/git.c b/git.c\nindex 86dcfee..01ddf06 100644\n--- a/git.c\n+++ b/git.c\n@@ -368,6 +368,7 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"verify-pack\", cmd_verify_pack },\n \t\t{ \"show-ref\", cmd_show_ref, RUN_SETUP },\n \t\t{ \"pack-refs\", cmd_pack_refs, RUN_SETUP },\n+\t\t{ \"config-mak\", cmd_config_mak, },\n \t};\n \tint i;\n \tstatic const char ext[] = STRIP_EXTENSION;\ndiff --git a/help.c b/help.c\nindex e8db31f..422259a 100644\n--- a/help.c\n+++ b/help.c\n@@ -365,3 +365,10 @@ int cmd_version(int argc, const char **argv, const char *prefix)\n \tprintf(\"git version %s\\n\", git_version_string);\n \treturn 0;\n }\n+\n+extern const char *config_mak;\n+int cmd_config_mak(int argc, const char **argv, const char *prefix)\n+{\n+\tfputs(config_mak, stdout);\n+\treturn 0;\n+}\n-- \n1.6.5.1.3.g9d77a\n"},{"id":"126224","messageId":"20091029002425.GC1057@sigill.intra.peff.net","threadId":"21413","inReplyTo":"20091029002229.GA986@sigill.intra.peff.net","subject":"[PATCH 3/3] add autoupdate feature","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-29T00:24:25Z","receivedAt":"2009-10-29T00:24:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Users can't be bothered to keep their software up to date, so\nwe must do it for them.  Whenever any git command is\ninvoked, this patch checks for new releases of git at\nkernel.org, and automatically upgrades your version of git.\n\nSigned-off-by: Sverre Rabbelier <srabbelier@gmail.com>\nSigned-off-by: Sam Vilain <sam@vilain.net>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\nSigned-off-by: Nick Edelen <sirnot@gmail.com>\nSigned-off-by: \"J.H.\" <warthog9@kernel.org>\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\nSigned-off-by: Jeff King <peff@peff.net>\n---\n .gitignore          |    1 +\n Makefile            |    1 +\n git-autoupdate.perl |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++\n git.c               |    9 +++++++-\n 4 files changed, 68 insertions(+), 1 deletions(-)\n create mode 100644 git-autoupdate.perl\n\ndiff --git a/.gitignore b/.gitignore\nindex cf0d8b9..5a2703d 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -10,6 +10,7 @@ git-annotate\n git-apply\n git-archimport\n git-archive\n+git-autoupdate\n git-bisect\n git-bisect--helper\n git-blame\ndiff --git a/Makefile b/Makefile\nindex ae4b9fc..ba386a4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -335,6 +335,7 @@ SCRIPT_SH += git-submodule.sh\n SCRIPT_SH += git-web--browse.sh\n \n SCRIPT_PERL += git-add--interactive.perl\n+SCRIPT_PERL += git-autoupdate.perl\n SCRIPT_PERL += git-difftool.perl\n SCRIPT_PERL += git-archimport.perl\n SCRIPT_PERL += git-cvsexportcommit.perl\ndiff --git a/git-autoupdate.perl b/git-autoupdate.perl\nnew file mode 100644\nindex 0000000..c8ca10b\n--- /dev/null\n+++ b/git-autoupdate.perl\n@@ -0,0 +1,58 @@\n+#!/usr/bin/perl\n+\n+use LWP::Simple;\n+use strict;\n+\n+my $ROOT = \"http://kernel.org/pub/software/scm/git\";\n+\n+my $us = our_git_version();\n+my $them = latest_git_version();\n+\n+if (compare_versions($us, $them) < 0) {\n+\tprint STDERR <<EOF;\n+A new version of git is available! Auto-installing version $them.\n+EOF\n+}\n+else {\n+\texit 0;\n+}\n+\n+upgrade($them);\n+exit 42;\n+\n+sub our_git_version {\n+\tlocal $_ = `git version`;\n+\t/^git version (.*?)(\\.\\d+\\.g[a-f0-9]+)?(\\.dirty)?$/\n+\t\tor die \"unable to read git version: $_\";\n+\treturn $1;\n+}\n+\n+sub latest_git_version {\n+\tlocal $_ = get(\"$ROOT/\");\n+\tmy @versions = /git-([0-9.]+)\\.tar\\.gz/g\n+\t\tor die \"unable to find any git versions at $ROOT\";\n+\t# git version numbers have always sorted lexicographically so far,\n+\t# so let's just assume that will be the case forever\n+\treturn (sort @versions)[-1];\n+}\n+\n+sub compare_versions {\n+\t# let's assume lexicographical sorting again\n+\treturn $_[0] cmp $_[1];\n+}\n+\n+sub upgrade {\n+\tmy $version = shift;\n+\tmy $fn = \"git-$version.tar.gz\";\n+\tgetstore(\"$ROOT/$fn\", \"/tmp/$fn\") == 200\n+\t\tor die \"unable to fetch $ROOT/$fn\";\n+\tmy $rc = system qq(\n+\t\tcd /tmp &&\n+\t\tgunzip -c $fn | tar xf - &&\n+\t\tcd git-$version &&\n+\t\tgit config-mak >config.mak &&\n+\t\tmake install\n+\t);\n+\t$rc == 0 or die \"failed to upgrade git\";\n+\tsystem(\"less /tmp/git-$version/RelNotes\");\n+}\ndiff --git a/git.c b/git.c\nindex 01ddf06..959ad52 100644\n--- a/git.c\n+++ b/git.c\n@@ -462,10 +462,17 @@ int main(int argc, const char **argv)\n \n \tif (!getenv(\"GIT_NOSPLASH\") && !(argv[1] && !strcmp(argv[1], \"splash\"))) {\n \t\tconst char *a[] = { \"splash\", NULL };\n-\t\tconst char *e[] = { \"GIT_NOSPLASH=1\", NULL };\n+\t\tconst char *e[] = { \"GIT_NOSPLASH=1\", \"GIT_NOAUTOUPDATE=1\", NULL };\n \t\trun_command_v_opt_cd_env(a, RUN_GIT_CMD, NULL, e);\n \t}\n \n+\tif (!getenv(\"GIT_NOAUTOUPDATE\")) {\n+\t\tconst char *a[] = { \"autoupdate\", NULL };\n+\t\tconst char *e[] = { \"GIT_NOSPLASH=1\", \"GIT_NOAUTOUPDATE=1\", NULL };\n+\t\tif (run_command_v_opt_cd_env(a, RUN_GIT_CMD, NULL, e) == 42)\n+\t\t\texit(run_command_v_opt_cd_env(argv, 0, NULL, e));\n+\t}\n+\n \t/*\n \t * \"git-xxxx\" is the same as \"git xxxx\", but we obviously:\n \t *\n-- \n1.6.5.1.3.g9d77a\n"},{"id":"126226","messageId":"b4087cc50910281828o2a26999fr81b19dc69791abb2@mail.gmail.com","threadId":"21413","inReplyTo":"20091029002400.GA1057@sigill.intra.peff.net","subject":"Re: [PATCH 1/3] add splash screen","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-10-29T01:28:46Z","receivedAt":"2009-10-29T01:28:46Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"On Wed, Oct 28, 2009 at 7:24 PM, Jeff King <peff@peff.net> wrote:\n> Because bash completion is so slow to start, we need to\n> entertain users with a splash screen, so reuse the one from\n> git-gui.\n\nAccording to Wolfram Alpha, you're about 22 weeks off in your timing.\n"},{"id":"126228","messageId":"4AE8FD01.3070009@gmail.com","threadId":"21413","inReplyTo":"20091029002400.GA1057@sigill.intra.peff.net","subject":"Re: [PATCH 1/3] add splash screen","fromName":"A Large Angry SCM","fromEmail":"gitzilla@gmail.com","sentAt":"2009-10-29T02:25:05Z","receivedAt":"2009-10-29T02:25:05Z","isPatch":true,"sender":{"key":"gitzilla@gmail.com","avatar":"https://gravatar.com/avatar/354625c442439908ff3dd99757dee330e29e9df7847472384faf7a00add247fb?d=mp&s=160"},"body":"Jeff King wrote:\n> Because bash completion is so slow to start, we need to\n> entertain users with a splash screen, so reuse the one from\n> git-gui.\n> \n> Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>\n> Signed-off-by: Sam Vilain <sam@vilain.net>\n> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n> Signed-off-by: Nick Edelen <sirnot@gmail.com>\n> Signed-off-by: \"J.H.\" <warthog9@kernel.org>\n> Signed-off-by: Brandon Casey <drafnel@gmail.com>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  .gitignore    |    1 +\n>  Makefile      |    3 +++\n>  git-splash.sh |    4 ++++\n>  git.c         |    6 ++++++\n>  4 files changed, 14 insertions(+), 0 deletions(-)\n>  create mode 100644 git-splash.sh\n> \n\nIf you're going to assume that the user has a working network connection \nfor every git command invoked for part 3 of this series, why not get the \nlogo image from kernel.org also so you always have the most up-to-date logo?\n"},{"id":"126261","messageId":"alpine.DEB.1.00.0910291159110.3687@felix-maschine","threadId":"21413","inReplyTo":"20091029002229.GA986@sigill.intra.peff.net","subject":"Re: [PATCH 0/3] increase user-friendliness","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-10-29T10:59:35Z","receivedAt":"2009-10-29T10:59:35Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 28 Oct 2009, Jeff King wrote:\n\n> Git has a reputation as being unfriendly to users. Let's fix that by \n> adding some features implemented by more user-friendly programs.\n\nSo the bar for pirate patches has been raised to patch series now?\n\nLOL,\nDscho\n"},{"id":"126266","messageId":"4AE98F07.4050401@gnu.org","threadId":"21413","inReplyTo":"20091029002400.GA1057@sigill.intra.peff.net","subject":"Re: [PATCH 1/3] add splash screen","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2009-10-29T12:48:07Z","receivedAt":"2009-10-29T12:48:07Z","isPatch":true,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"On 10/29/2009 01:24 AM, Jeff King wrote:\n> Because bash completion is so slow to start, we need to\n> entertain users with a splash screen, so reuse the one from\n> git-gui.\n\nI suggest adding \"wm overrideredirect . 1; wm geometry . +300+300\".\n\nPaolo\n"},{"id":"126403","messageId":"20091030182916.GB19901@coredump.intra.peff.net","threadId":"21413","inReplyTo":"alpine.DEB.1.00.0910291159110.3687@felix-maschine","subject":"Re: [PATCH 0/3] increase user-friendliness","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-30T18:29:17Z","receivedAt":"2009-10-30T18:29:17Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 29, 2009 at 11:59:35AM +0100, Johannes Schindelin wrote:\n\n> On Wed, 28 Oct 2009, Jeff King wrote:\n> \n> > Git has a reputation as being unfriendly to users. Let's fix that by \n> > adding some features implemented by more user-friendly programs.\n> \n> So the bar for pirate patches has been raised to patch series now?\n\nWell, I wasn't intending to do a series, but strangely when you ask in a\nroom full of git developers, \"what ridiculous joke patch would you like\nme to code this afternoon?\", you get way more answers than you wanted. I\nhad to start rejecting suggestions. ;)\n\n-Peff\n\nPS Thanks to all who responded with ridiculous suggestions in your\nreviews. I'm not going to bother keeping the thread alive by responding\nto each, though. :)\n"}]}