Я пытаюсь отформатировать вывод журнала git в журнал изменений в формате asciidoc.Я сделал это, используя git log --format.Затем мне нужно добавить номер ошибки, который содержится в сообщении фиксации, в тему.
Вводимые ниже данные генерируются с использованием
git log --reverse --no-merges $1..$2 --format='* %s%n+%n%b' | \
sed -e '/^Change-Id:.*$/d' | sed -e '/^Signed-off-by:.*$/d'
Пример ввода:
* This is subject without issue number
+
There will be multiple lines of text and multiple paragraphs.
2nd paragraph of the commit message.
* This is commit with issue number
+
There can be multiple lines of comment message.
2nd paragraph of the commit message. A line with Bug: issue ###
will be the last line. I need to combine the issue ### with
the subject line.
Bug: issue 1234
* This is commit with issue number in Issue: 1235 format
+
There can be multiple lines of comment message.
2nd paragraph of the commit message. A line with Issue: ###
will be the last line. I need to combine the issue ### with
the subject line.
Issue: 1235
Ожидаемый результат
* This is subject without issue number
+
There will be multiple lines of text and multiple paragraphs.
2nd paragraph of the commit message.
* issue 1234 This is commit with issue number
+
There can be multiple lines of comment message.
2nd paragraph of the commit message. A line with Bug: issue ###
will be the last line. I need to combine the issue ### with
the subject line.
* issue 1235 This is commit with issue number in Issue: 1235 format
+
There can be multiple lines of comment message.
2nd paragraph of the commit message. A line with Issue: ###
will be the last line. I need to combine the issue ### with
the subject line.
Я хотел бы знать, можно ли это сделать с помощью Awk.Не могли бы вы предоставить код Awk, который можно выполнить выше?Если нет, каковы другие варианты?Я хотел бы создать сценарий оболочки, который генерирует желаемый результат.