Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to format code of type git in jira issue comments? Edited

Liwei Dai I'm New Here Jun 29, 2021

Hello, when I paste my code on comments, I typically like to show what I have changed to the original code, meaning pasting the result of running `git diff`. For example:

diff --git a/translation/tensorflow/bert/run_finetune.sh b/translation/tensorflow/bert/run_finetune.sh
index 825e060..ebfec17 100644
--- a/translation/tensorflow/bert/run_finetune.sh
+++ b/translation/tensorflow/bert/run_finetune.sh
@@ -3,7 +3,7 @@
# Dataset: GLUE/MRPC
# Model: bert-base
MODEL="bert-base"
-EPOCHS=${EPOCHS:-3}
+EPOCHS=${EPOCHS:-1}
TRAIN_BATCH_SIZE=16
export BERT_BASE_DIR=models/${MODEL}
export GLUE_DIR=glue_data

In a typical bash console, you can easily see `git diff` properly formatted, e.g. lines started with a `-` will be in color red, lines started with a `+` will be in green color. How can this be done in jira issue comment? I can't find any code type similar. The default is java, I try to modify it to `git`, but it responeded that it is not supported.

I also tried to add nested text formating inside the code block, but still not working. E.g.:

diff --git a/translation/tensorflow/bert/run_finetune.sh b/translation/tensorflow/bert/run_finetune.sh
index 825e060..ebfec17 100644

{color:red}
--- a/translation/tensorflow/bert/run_finetune.sh

{color}

{color:green}
+++ b/translation/tensorflow/bert/run_finetune.sh

{color}
@@ -3,7 +3,7 @@
# Dataset: GLUE/MRPC
# Model: bert-base
MODEL="bert-base"
-EPOCHS=${EPOCHS:-3}
+EPOCHS=${EPOCHS:-1}
TRAIN_BATCH_SIZE=16
export BERT_BASE_DIR=models/${MODEL}
export GLUE_DIR=glue_data

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you