John Keeping <j...@keeping.me.uk> writes:

>> I do not think we would want to worry about comment_char being a
>> funny character that can possibly interfere with regexp.  Can't we
>> do this with "git stripspace" piped to "wc -l" or something?
>
> I didn't know about "git stripspace",...
>> > -# If you remove a line here THAT COMMIT WILL BE LOST.
>> > +  sed -e "s/^/$comment_char /" >>"$todo" <<EOF
>> 
>> When $comment_char is slash or backslash this will break.
>> Perhaps "stripspace --comment-lines" can be used here.
>
> Not in this case - this is adding the comment char in front of each
> line.  Is there a better option than this?
>
>       while read -r line
>       do
>               printf '%s %s\n' "$comment_char" "$line"
>       done >> "$todo" <<EOF
>       ...
>       EOF

Perhaps

        git stripspace --comment-lines <<EOF
        ...
        EOF

is a better option that that loop.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to