From: Han-Wen Nienhuys Date: Thu, 21 Sep 2017 15:31:55 GMT Subject: [GSoC][PATCH v4 3/4] submodule: port set_name_rev() from shell to C Message-ID: <20170921153155.8544-1-hanwen@google.com> In-Reply-To: <20170828115558.28297-4-pc44800@gmail.com> LGTM with nits commit message: "revision name, and later handles its formating and printing." typo: formatting + if (!capture_command(&cp, &sb, 0) && sb.len) { + strbuf_strip_suffix(&sb, "\n"); + return strbuf_detach(&sb, NULL); + } you discard all output if these commands fail, so if the argument is a not a submodule, or the other is not a sha1, it will just print nothing without error message. Maybe that is OK, though? I don't see documentation for these commands, so maybe this is not meant to be usable?