Re: [PATCH 2/3] add new Git::Repo API
- From
- Lea Wiemann <lewiemann@gmail.com>
- Date
- Jul 15, 2008, 00:11 UTC
- Message-ID
- <487BEB30.8010705@gmail.com>
- In-Reply-To
- <200807150141.39186.jnareb@gmail.com>
Jakub Narebski wrote:
> Git->output_pipe('ls-remotes', $URL, '--heads');I'd make it cmd => ['ls-remotes', $URL, '--heads'] to avoid making the interface inflexible, and perhaps add a git_binary option to specify the binary path. (Not that I'm suggesting something like this should be added right now; but perhaps it'll be needed at some point.)
> I think that the solution might be some output_pipe option on how to > treat command exit status, command STDERR, and errors when invoking > command (for example command not found).
You read my design notes about error handling at the top of <487BD0F3.2060508@gmail.com>, and you noticed there's max_exit_code in cmd_output? With the approach to error handling I described, open/exit errors can cause the method to die, and stderr can be ignored.
If you're trying to implement a more sophisticated error handling approach, be warned that you're opening a can of worms. ;) If you're aiming for something like that, it should be kept out of Git::Repo (which has very coherent error handling as-is), and preferably be discussed under a separate subject, since it's way beyond the scope of this patch.