Tags: dyrone/git
Tags
notes.c: introduce "--[no]-stripspace" option This commit introduces a new option "--[no]-stripspace" to git notes append, git notes edit, and git notes add. This option allows users to control whether the note message need to stripped out. The default value of this option is "true", which means the note message will be stripped out by default. If the user wants to preserve the note message, can use "--no-stripspace" option. There are two reasons why we need this option: 1. The note message is stripped out by default, which is not consistent with the behavior of "git commit" command. This may confuse users. 2. The note message is stripped out by default, which is not consistent with the behavior of "git notes show" command. This may confuse users. Signed-off-by: Teng Long <[email protected]>
notes.c: introduce '--separator=<paragraph-break>' option When adding new notes or appending to an existing notes, we will insert a blank line between the paragraphs, like: $ git notes add -m foo -m bar $ git notes show HEAD | cat foo bar The default behavour sometimes is not enough, the user may want to use a custom delimiter between paragraphs, like when specifiy '-m', '-F', '-C', '-c' options. So this commit introduce a new '--separator' option for 'git notes add' and 'git notes append', for example when execute: $ git notes add -m foo -m bar --separator="-" $ git notes show HEAD | cat foo - bar A newline is added to the value given to --separator if it does not end with one already. So execute: $ git notes add -m foo -m bar --separator="-" and $ export LF=" " $ git notes add -m foo -m bar --separator="-$LF" Running A and B produces the same result. Signed-off-by: Teng Long <[email protected]>
notes.c: introduce '--separator=<paragraph-break>' option When adding new notes or appending to an existing notes, we will insert a blank line between the paragraphs, like: $ git notes add -m foo -m bar $ git notes show HEAD | cat foo bar The default behavour sometimes is not enough, the user may want to use a custom delimiter between paragraphs, like when specifiy '-m', '-F', '-C', '-c' options. So this commit introduce a new '--separator' option for 'git notes add' and 'git notes append', for example when execute: $ git notes add -m foo -m bar --separator="-" $ git notes show HEAD | cat foo - bar A newline is added to the value given to --separator if it does not end with one already. So execute: $ git notes add -m foo -m bar --separator="-" and $ export LF=" " $ git notes add -m foo -m bar --separator="-$LF" Running A and B produces the same result. Signed-off-by: Teng Long <[email protected]>
PreviousNext