On 11/04/2016 08:13 PM, Ian Jackson wrote: > I wanted to be able to syntax check lots of proposed refs quickly > (please don't ask why - it's complicated!) > > So I added a --stdin option to git-check-ref-format. Also it has > --report-errors now too so you can get some kind of useful error > message if it complains. > > It's still not really a good batch mode but it's good enough for my > use case. To improve it would involve a new command line option to > offer a suitable stdout output format. > > There are three small refactoring patches and the two patches with new > options and corresponding docs. > > Thanks for your attention. > > FYI I am not likely to need this again in the near future: it's a > one-off use case. So my effort for rework is probably limited. I > thought I'd share what I'd done in what I hope is a useful form, > anyway. Thanks for your patches. I left some comments about the individual patches. I don't know whether this feature will be popular, but it's not a lot of code to add it, so it would be OK with me. Especially given that the output is not especially machine-readable, it might be more consistent with other commands to call the new feature `--verbose` rather than `--report-errors`. If it is thought likely that scripts will want to leave a pipe open to this command and feed it one query at a time, then it would be helpful to flush stdout after each reference's result is written. If the opposite use case is common (mass processing of refnames), we could always add a `--buffer` option like the one that `git cat-file --batch` has. Michael