From: Kaartic Sivaraam Date: Thu, 14 May 2020 09:07:37 GMT Subject: Re: [PATCH 1/2] submodule: port subcommand 'set-branch' from shell to C Message-ID: <4e36c8a0-4f43-79f8-137f-5fd080066af6@gmail.com> In-Reply-To: <20200513201737.55778-1-shouryashukla.oo@gmail.com> -Cc: chriscool@tuxfamily.org (seems redundant; Also, .mailmap confirms that christian.couder@gmail.com is Christian's preference) On 14-05-2020 01:47, Shourya Shukla wrote: > > The extra '$branch' on line 752 was because of Christian's help after > reference from TLDP's Parameter Subsitution documentation: > https://www.tldp.org/LDP/abs/html/parameter-substitution.html > For those who lack the context, during the conversion of the script Shourya faced an issue where the '--branch' argument did not work as expected. He described the issue in a private e-mail where Christian pointed out the following (quoting his reply hoping he doesn't mind): > On Tue, May 12, 2020 at 5:55 PM Christian Couder wrote: >> >> In your commit (in submodule.sh line 781) there is: >> >> `git ${wt_prefix:+-C "$wt_prefix"} ${prefix:+--super-prefix >> "$prefix"} submodule--helper set-branch ${GIT_QUIET:+--quiet} >> ${branch:+--branch} ${default:+--default} -- "$@"` > > Actually the issue might come from the above. I think it should use ${branch:+--branch $branch} instead of ${branch:+--branch}. > > See: https://www.tldp.org/LDP/abs/html/parameter-substitution.html That's why Shourya mentions the '$branch' as extra. Of course, that's how it is supposed to be in the first place :) -- Sivaraam