Re: [GUILT 04/28] Allow "guilt import-commit" to run from a dir which contains spaces.
- From
- Jeff Sipek <jeffpc@josefsipek.net>
- Date
- Mar 23, 2014, 17:04 UTC
- Message-ID
- <20140323170409.GG1661@meili.valhalla.31bits.net>
- In-Reply-To
- <1395387126-13681-5-git-send-email-cederp@opera.com>
On Fri, Mar 21, 2014 at 08:31:42AM +0100, Per Cederqvist wrote:
Show 15 quoted lines
> Signed-off-by: Per Cederqvist <cederp@opera.com> > --- > guilt-import-commit | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/guilt-import-commit b/guilt-import-commit > index 20dcee2..9488ded 100755 > --- a/guilt-import-commit > +++ b/guilt-import-commit > @@ -23,7 +23,7 @@ if ! must_commit_first; then > fi > > disp "About to begin conversion..." >&2 > -disp "Current head: `cat $GIT_DIR/refs/heads/\`git_branch\``" >&2 > +disp "Current head: `cat \"$GIT_DIR\"/refs/heads/\`git_branch\``" >&2
I wonder if it'd be better to use 'git rev-parse' here instead of looking at the refs directly.
IOW,
disp "Current head: `git rev-parse \`git_branch\``" >&2
Maybe even $() instead of the inner `` to clean it up some more.
Jeff.
Show 23 quoted lines
> > for rev in `git rev-list $rhash`; do > s=`git log --pretty=oneline -1 $rev | cut -c 42-` > @@ -46,7 +46,7 @@ for rev in `git rev-list $rhash`; do > do_make_header $rev > echo "" > git diff --binary $rev^..$rev > - ) > $GUILT_DIR/$branch/$fname > + ) > "$GUILT_DIR/$branch/$fname" > > # FIXME: grab the GIT_AUTHOR_DATE from the commit object and set the > # timestamp on the patch > @@ -68,6 +68,6 @@ for rev in `git rev-list $rhash`; do > done > > disp "Done." >&2 > -disp "Current head: `cat $GIT_DIR/refs/heads/\`git_branch\``" >&2 > +disp "Current head: `cat \"$GIT_DIR\"/refs/heads/\`git_branch\``" >&2 > > } > -- > 1.8.3.1 >
-- It used to be said [...] that AIX looks like one space alien discovered Unix, and described it to another different space alien who then implemented AIX. But their universal translators were broken and they'd had to gesture a lot. - Paul Tomblin