git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: Elia Pinto <gitter.spiros@gmail.com>
Subject: [PATCH 059/144] t5305-include-tag.sh: use the $( ... ) construct for command substitution
Date: Tue, 25 Mar 2014 01:25:04 -0700	[thread overview]
Message-ID: <1395735989-3396-60-git-send-email-gitter.spiros@gmail.com> (raw)
In-Reply-To: <1395735989-3396-1-git-send-email-gitter.spiros@gmail.com>

The Git CodingGuidelines prefer the $( ... ) construct for command
substitution instead of using the back-quotes, or grave accents (`..`).

The backquoted form is the historical method for command substitution,
and is supported by POSIX. However,all but the simplest uses become
complicated quickly. In particular,embedded command substitutions
and/or the use of double quotes require careful escaping with the backslash
character. Because of this the POSIX shell adopted the $(…) feature from
the Korn shell.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 t/t5305-include-tag.sh |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t5305-include-tag.sh b/t/t5305-include-tag.sh
index b061864..74b4a03 100755
--- a/t/t5305-include-tag.sh
+++ b/t/t5305-include-tag.sh
@@ -3,20 +3,20 @@
 test_description='git pack-object --include-tag'
 . ./test-lib.sh
 
-TRASH=`pwd`
+TRASH=$(pwd)
 
 test_expect_success setup '
 	echo c >d &&
 	git update-index --add d &&
-	tree=`git write-tree` &&
-	commit=`git commit-tree $tree </dev/null` &&
+	tree=$(git write-tree) &&
+	commit=$(git commit-tree $tree </dev/null) &&
 	echo "object $commit" >sig &&
 	echo "type commit" >>sig &&
 	echo "tag mytag" >>sig &&
 	echo "tagger $(git var GIT_COMMITTER_IDENT)" >>sig &&
 	echo >>sig &&
 	echo "our test tag" >>sig &&
-	tag=`git mktag <sig` &&
+	tag=$(git mktag <sig) &&
 	rm d sig &&
 	git update-ref refs/tags/mytag $tag && {
 		echo $tree &&
-- 
1.7.10.4

  parent reply	other threads:[~2014-03-25  8:32 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25  8:24 [PATCH 000/144] Use the $( ... ) construct for command substitution instead of using the back-quotes Elia Pinto
2014-03-25  8:24 ` [PATCH 001/144] check-builtins.sh: use the $( ... ) construct for command substitution Elia Pinto
2014-03-25  8:35   ` Matthieu Moy
2014-03-25 10:03     ` Elia Pinto
2014-03-25  8:24 ` [PATCH 002/144] git-am.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 003/144] git-pull.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 004/144] git-rebase--merge.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 005/144] git-rebase.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 006/144] git-stash.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 007/144] git-web--browse.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 008/144] unimplemented.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 009/144] t0001-init.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 010/144] t0010-racy-git.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 011/144] t0020-crlf.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 012/144] t0025-crlf-auto.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 013/144] t0026-eol-config.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 014/144] t0030-stripspace.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 015/144] t0204-gettext-reencode-sanity.sh: " Elia Pinto
2014-03-25  8:36   ` Matthieu Moy
2014-03-25  9:51     ` Elia Pinto
2014-03-25  8:24 ` [PATCH 016/144] t0300-credentials.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 017/144] t1000-read-tree-m-3way.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 018/144] t1001-read-tree-m-2way.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 019/144] t1002-read-tree-m-u-2way.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 020/144] t1003-read-tree-prefix.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 021/144] t1004-read-tree-m-u-wf.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 022/144] t1020-subdirectory.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 023/144] t1050-large.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 024/144] t1100-commit-tree-options.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 025/144] t1401-symbolic-ref.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 026/144] t1410-reflog.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 027/144] t1511-rev-parse-caret.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 028/144] t1512-rev-parse-disambiguation.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 029/144] t2102-update-index-symlinks.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 030/144] t3030-merge-recursive.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 031/144] t3100-ls-tree-restrict.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 032/144] t3101-ls-tree-dirname.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 033/144] t3210-pack-refs.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 034/144] t3403-rebase-skip.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 035/144] t3511-cherry-pick-x.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 036/144] t3600-rm.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 037/144] t3700-add.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 038/144] t3905-stash-include-untracked.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 039/144] t3910-mac-os-precompose.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 040/144] t4006-diff-mode.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 041/144] t4010-diff-pathspec.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 042/144] t4012-diff-binary.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 043/144] t4013-diff-various.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 044/144] t4014-format-patch.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 045/144] t4036-format-patch-signer-mime.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 046/144] t4038-diff-combined.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 047/144] t4057-diff-combined-paths.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 048/144] t4116-apply-reverse.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 049/144] t4119-apply-config.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 050/144] t4204-patch-id.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 051/144] t5000-tar-tree.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 052/144] t5003-archive-zip.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 053/144] t5100-mailinfo.sh: " Elia Pinto
2014-03-25  8:24 ` [PATCH 054/144] t5300-pack-object.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 055/144] t5301-sliding-window.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 056/144] t5302-pack-index.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 057/144] t5303-pack-corruption-resilience.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 058/144] t5304-prune.sh: " Elia Pinto
2014-03-25  8:25 ` Elia Pinto [this message]
2014-03-25  8:25 ` [PATCH 060/144] t5500-fetch-pack.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 061/144] t5505-remote.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 062/144] t5506-remote-groups.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 063/144] t5510-fetch.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 064/144] t5515-fetch-merge-logic.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 065/144] t5516-fetch-push.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 066/144] t5517-push-mirror.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 067/144] t5520-pull.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 068/144] t5522-pull-symlink.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 069/144] t5530-upload-pack-error.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 070/144] t5537-fetch-shallow.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 071/144] t5538-push-shallow.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 072/144] t5550-http-fetch-dumb.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 073/144] t5551-http-fetch-smart.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 074/144] t5570-git-daemon.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 075/144] t5601-clone.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 076/144] t5700-clone-reference.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 077/144] t5710-info-alternate.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 078/144] t5900-repo-selection.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 079/144] t6001-rev-list-graft.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 080/144] t6002-rev-list-bisect.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 081/144] t6015-rev-list-show-all-parents.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 082/144] t6032-merge-large-rename.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 083/144] t6034-merge-rename-nocruft.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 084/144] t6111-rev-list-treesame.sh: " Elia Pinto
2014-03-25  8:52   ` Matthieu Moy
2014-03-25  9:52     ` Elia Pinto
2014-03-25  8:25 ` [PATCH 085/144] t6132-pathspec-exclude.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 086/144] t7001-mv.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 087/144] t7003-filter-branch.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 088/144] t7004-tag.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 089/144] t7006-pager.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 090/144] t7103-reset-bare.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 091/144] t7406-submodule-update.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 092/144] t7408-submodule-reference.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 093/144] t7504-commit-msg-hook.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 094/144] t7505-prepare-commit-msg-hook.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 095/144] t7602-merge-octopus-many.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 096/144] t7700-repack.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 097/144] t8003-blame-corner-cases.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 098/144] t9001-send-email.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 099/144] t9101-git-svn-props.sh: " Elia Pinto
2014-03-29 23:50   ` Eric Wong
2014-03-25  8:25 ` [PATCH 100/144] t9104-git-svn-follow-parent.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 101/144] t9105-git-svn-commit-diff.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 102/144] t9107-git-svn-migrate.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 103/144] t9108-git-svn-glob.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 104/144] t9109-git-svn-multi-glob.sh: " Elia Pinto
2014-03-25  8:25 ` [PATCH 105/144] t9110-git-svn-use-svm-props.sh: " Elia Pinto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395735989-3396-60-git-send-email-gitter.spiros@gmail.com \
    --to=gitter.spiros@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).