git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
To: Petr Baudis <pasky@suse.cz>
Cc: git@vger.kernel.org
Subject: [PATCH] Fix cg-admin-uncommit
Date: Fri, 30 Sep 2005 20:35:46 +0200	[thread overview]
Message-ID: <20050930183545.15895.61691.stgit@zion.home.lan> (raw)

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

It uses $1 rather than ${ARGS[0]}, which breaks when optparse found some
options, i.e. with cg-admin-uncommit -t (cg-object-id -c -t is not nice).

Please, document optparse to explain this. It's absolutely non-obvious, and when
I first hit this I thought optparse was buggy but couldn't make my way to the
fix.

Both because I was using cogito rather than debugging it, and even considering
the obfuscation level, but above all I was looking for a call to shift in
optshift and didn't find it. Now I understood the thing I pity myself, though.

Btw, why doesn't optparse consume all the cmd arguments via shift, making thus
sure that $1 never works at all?

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 cg-admin-uncommit |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cg-admin-uncommit b/cg-admin-uncommit
--- a/cg-admin-uncommit
+++ b/cg-admin-uncommit
@@ -47,7 +47,7 @@ done
 
 base=$(cg-object-id -c) || exit 1
 
-commit=$(cg-object-id -c "$1") || exit 1
+commit=$(cg-object-id -c "${ARGS[0]}") || exit 1
 git-rev-list $base | grep -q $commit || \
 	die "$commit: not an ancestor of HEAD"
 

             reply	other threads:[~2005-09-30 18:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-30 18:35 Paolo 'Blaisorblade' Giarrusso [this message]
2005-10-11 23:16 ` [PATCH] Fix cg-admin-uncommit Petr Baudis

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=20050930183545.15895.61691.stgit@zion.home.lan \
    --to=blaisorblade@yahoo.it \
    --cc=git@vger.kernel.org \
    --cc=pasky@suse.cz \
    /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).