Re: [PATCH] Allow custom "comment char"
- From
Ralf Thielow <ralf.thielow@gmail.com>
- Date
- Jan 16, 2013, 08:17 UTC
- Message-ID
- <CAN0XMOJPgGXUeOBC=ubO0d7NweEihJvQbf2O6wxazh4juLi02g@mail.gmail.com>
- In-Reply-To
- <7vmww9zlwj.fsf@alter.siamese.dyndns.org>
2013/1/16 Junio C Hamano <gitster@pobox.com>:
Show 26 quoted lines
>>> diff --git a/git-submodule.sh b/git-submodule.sh
>>> index 22ec5b6..1b8d95f 100755
>>> --- a/git-submodule.sh
>>> +++ b/git-submodule.sh
>>> @@ -975,13 +975,19 @@ cmd_summary() {
>>> echo
>>> done |
>>> if test -n "$for_status"; then
>>> + comment_char=`git config core.commentchar`
>>> + if [ ! -n "$comment_char" ]; then
>>> + comment_char='#'
>>> + elif [ ${#comment_char} -gt 1 ]; then
>>
>> Not portable, I think.
>>
>>> + echo "$comment_char"
>>> + sed -e "s|^|$comment_char |" -e "s|^$comment_char $|$comment_char|"
>>
>> Can $comment_char be a '|'?
>
> I think it may be the easiest to teach one of the pure-helper
> commands, e.g. "git stripspace", to do this kind of thing for you
> with a new option.
>
> To summarize, along the lines of the attached patch (on top of
> jc/custom-comment-char topic).Very good idea. I'll integrate. Thanks