9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] git/revert: fix empty invocation
Date: Thu, 04 Nov 2021 15:48:07 -0400	[thread overview]
Message-ID: <E9C03D9EB20CE3E981439B15D47A4A98@eigenstate.org> (raw)
In-Reply-To: <YYQuUsuOdyNNW4dI@imac.0x30.net>

Quoth Kyle Milz <krwmilz@gmail.com>:
> hi,
> 
> git/revert requires a file name argument, but when none is given
> it fails in a strange way:
> 
> 	% git/revert
> 	usage: cleanname [-d pwd] name...
> 	/bin/git/revert:15: null list in concatenation
> 
> it looks like getflags does not verify *arguments*, and the 'args'
> variable is only used by aux/usage. diff below adds a check
> for a nonzero amount of arguments. here is the new output:
> 
> 	% git/revert
> 	usage: revert [-c query] file ...
> 
> i tested -c to make sure it works like it did without this change.
> 
> kyle
> 
> diff 3f495077869362629de9d0c0b070ffca10ceb729 uncommitted
> --- a/sys/src/cmd/git/revert
> +++ b/sys/src/cmd/git/revert
> @@ -5,7 +5,8 @@
>  gitup
>  
>  flagfmt='c:query query' args='file ...'
> -eval `''{aux/getflags $*} || exec aux/usage
> +if (! eval `''{aux/getflags $*} || ~ $#* 0)
> +	exec aux/usage
>  
>  commit=$gitfs/HEAD
>  if(~ $#query 1)
> 

lgtm.

      reply	other threads:[~2021-11-04 19:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 19:02 Kyle Milz
2021-11-04 19:48 ` ori [this message]

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=E9C03D9EB20CE3E981439B15D47A4A98@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.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).