{"thread":{"id":"3388","subject":"[PATCH] Keep Porcelainish from failing by broken ident after making changes.","startedAt":"2006-02-19T04:59:17Z","lastAt":"2006-02-19T04:59:17Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16396","messageId":"7v1wy0lza2.fsf@assigned-by-dhcp.cox.net","threadId":"3388","inReplyTo":null,"subject":"[PATCH] Keep Porcelainish from failing by broken ident after making changes.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-19T04:59:17Z","receivedAt":"2006-02-19T04:59:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"empty ident not allowed\" error makes commit-tree fail, so we\nare already safer in that we would not end up with commit\nobjects that have bogus names on the author or committer fields.\nHowever, before commit-tree is called there are already changes\nmade to the index file and the working tree.  The operation can\nbe resumed after fixing the environment problem, but when this\ntriggers to a newcomer with unusable gecos, the first question\nbecomes \"what did I lose and how would I recover\".\n\nThis patch modifies some Porcelainish commands to verify\nGIT_COMMITTER_IDENT as soon as we know we are going to make some\ncommits before doing much damage to prevent confusion.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n * This is a follow-up on the previous \"delay empty ident\" error\n   one.  \"git pull random-place\" otherwise would confuse and\n   scare new users, even though what it leaves would often be a\n   perfectly fine committable state.\n\n git-am.sh        |    4 +++-\n git-applymbox.sh |    2 ++\n git-merge.sh     |    5 +++++\n git-resolve.sh   |    3 +++\n 4 files changed, 13 insertions(+), 1 deletions(-)\n\ne3b59a44f6705896db80965427a7cf9e2112634b\ndiff --git a/git-am.sh b/git-am.sh\nindex 98b9215..85ecada 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -1,11 +1,13 @@\n #!/bin/sh\n #\n-#\n+# Copyright (c) 2005, 2006 Junio C Hamano\n \n USAGE='[--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>\n   or, when resuming [--skip | --resolved]'\n . git-sh-setup\n \n+git var GIT_COMMITTER_IDENT >/dev/null || exit\n+\n stop_here () {\n     echo \"$1\" >\"$dotest/next\"\n     exit 1\ndiff --git a/git-applymbox.sh b/git-applymbox.sh\nindex 61c8c02..5569fdc 100755\n--- a/git-applymbox.sh\n+++ b/git-applymbox.sh\n@@ -21,6 +21,8 @@\n USAGE='[-u] [-k] [-q] [-m] (-c .dotest/<num> | mbox) [signoff]'\n . git-sh-setup\n \n+git var GIT_COMMITTER_IDENT >/dev/null || exit\n+\n keep_subject= query_apply= continue= utf8= resume=t\n while case \"$#\" in 0) break ;; esac\n do\ndiff --git a/git-merge.sh b/git-merge.sh\nindex 74f0761..2b4a603 100755\n--- a/git-merge.sh\n+++ b/git-merge.sh\n@@ -142,6 +142,8 @@ case \"$#,$common,$no_commit\" in\n 1,*,)\n \t# We are not doing octopus, not fast forward, and have only\n \t# one common.  See if it is really trivial.\n+\tgit var GIT_COMMITTER_IDENT >/dev/null || exit\n+\n \techo \"Trying really trivial in-index merge...\"\n \tgit-update-index --refresh 2>/dev/null\n \tif git-read-tree --trivial -m -u $common $head \"$1\" &&\n@@ -179,6 +181,9 @@ case \"$#,$common,$no_commit\" in\n \t;;\n esac\n \n+# We are going to make a new commit.\n+git var GIT_COMMITTER_IDENT >/dev/null || exit\n+\n case \"$use_strategies\" in\n '')\n \tcase \"$#\" in\ndiff --git a/git-resolve.sh b/git-resolve.sh\nindex 9263070..b53ede8 100755\n--- a/git-resolve.sh\n+++ b/git-resolve.sh\n@@ -50,6 +50,9 @@ case \"$common\" in\n \t;;\n esac\n \n+# We are going to make a new commit.\n+git var GIT_COMMITTER_IDENT >/dev/null || exit\n+\n # Find an optimum merge base if there are more than one candidates.\n LF='\n '\n-- \n1.2.1.g2902\n"}]}