Re: [PATCH v4] git-am: add option to extract email Message-Id: tag into commit log

2014-07-02 Thread Torsten Bögershausen
 diff --git a/git-am.sh b/git-am.sh
 index ee61a77..fd0181f 100755
 --- a/git-am.sh
 +++ b/git-am.sh
 @@ -39,6 +39,7 @@ committer-date-is-author-datelie about committer date
  ignore-date use current timestamp for author date
  rerere-autoupdate update the index with reused conflict resolution if 
 possible
  S,gpg-sign? GPG-sign commits
 +m,message-idcopy the Message-Id: header to the commit's tag stanza
  rebasing*   (internal use for git-rebase)
  
  . git-sh-setup
 @@ -371,7 +372,7 @@ split_patches () {
  prec=4
  dotest=$GIT_DIR/rebase-apply
  sign= utf8=t keep= keepcr= skip= interactive= resolved= rebasing= abort=
 -resolvemsg= resume= scissors= no_inbody_headers=
 +resolvemsg= resume= scissors= no_inbody_headers= message_id=
  git_apply_opt=
  committer_date_is_author_date=
  ignore_date=
 @@ -442,6 +443,8 @@ it will be removed. Please do not use it anymore.
   gpg_sign_opt=-S ;;
   --gpg-sign=*)
   gpg_sign_opt=-S${1#--gpg-sign=} ;;
 + -m|--message-id)
 + message_id=t ;;
   --)
   shift; break ;;
   *)
 @@ -565,6 +568,7 @@ Use \git am --abort\ to remove it.)
   echo  $git_apply_opt $dotest/apply-opt
   echo $threeway $dotest/threeway
   echo $sign $dotest/sign
 + echo $message_id $dotest/message-id
   echo $utf8 $dotest/utf8
   echo $keep $dotest/keep
   echo $scissors $dotest/scissors
 @@ -651,6 +655,10 @@ then
  else
   SIGNOFF=
  fi
 +if test $(cat $dotest/message-id) = t
Does the usage of '' inside of '' look good, or can we write like this:
if test $(cat $dotest/message-id) = t

--
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


Re: [PATCH v4] git-am: add option to extract email Message-Id: tag into commit log

2014-07-02 Thread Avi Kivity


On 07/02/2014 06:03 PM, Torsten Bögershausen wrote:

@@ -565,6 +568,7 @@ Use \git am --abort\ to remove it.)
echo  $git_apply_opt $dotest/apply-opt
echo $threeway $dotest/threeway
echo $sign $dotest/sign
+   echo $message_id $dotest/message-id
echo $utf8 $dotest/utf8
echo $keep $dotest/keep
echo $scissors $dotest/scissors
@@ -651,6 +655,10 @@ then
  else
SIGNOFF=
  fi
+if test $(cat $dotest/message-id) = t

Does the usage of '' inside of '' look good, or can we write like this:
if test $(cat $dotest/message-id) = t


With your change, it will fail if the file is missing or empty.

Complex shell scripts cannot be made to look good.  If that's a 
requirement then the script should be rewritten in a reasonable language.

--
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