Created
November 28, 2019 12:53
-
-
Save neninja/4a6df263b993c0468218e05742d43aaa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.graphviz.org/doc/info/colors.html | |
// http://larsbarkman.com/2015/08/26/alignmentmaps-with-graphviz/ | |
// https://stackoverflow.com/questions/33025639/how-to-align-subgraphs-in-dot-files | |
// https://stackoverflow.com/questions/7777722/top-down-subgraphs-left-right-inside-subgraphs | |
digraph AlignmentMap { | |
// General layout for the graph | |
rankdir=LR; // Direction of the graph Left to Right | |
node [style="rounded,filled",color=black,shape=box,fillcolor=white]; // Defines the default layout of the nodes | |
graph [style=filled, splines=line]; // Fills the subgraphs and defines the layout of the connections | |
// Coluna de explicação do contexto | |
subgraph cluster_explicacao_do_contexto { | |
label="Situação"; | |
graph [color=skyblue1]; | |
node [shape=box,style="filled,rounded",fontname=helvetica]; | |
e1 [label="Houve sucesso no pull"]; | |
e2 [label="No último commit local haviam modificações nos\n mesmos arquivos dos commits baixados com pull,\n obrigando o git a realizar auto-merging\n dos arquivos. Houve sucesso e os commitou,\n faltando somente a mensagem de commit"]; | |
e3 [label="No último commit local haviam modificações nos\n mesmos arquivos dos commits baixados com pull,\n obrigando o git a tentar realizar auto-merging\n dos arquivos. Não houve sucesso nos arquivos\n explicitados com \"CONFLICT(content)\", portanto\n os conflitos devem ser resolvidos manualmente"]; | |
e4 [label="Para fazer pull é necessário que todos arquivos\nestejam commitados"]; | |
} | |
// Coluna da mensagem exibida do git | |
subgraph cluster_mensagem_de_erro { | |
label="Mensagem do git"; | |
graph [color=mistyrose2]; | |
node [shape=box,style="filled,rounded",fontname=mono,fillcolor=indianred1,fontcolor=red4]; | |
m1 [label="Fast-foward"]; | |
m2 [label="Merge made by the\n'recursive' strategy"]; | |
m3 [label="Automatic merge failed;\nfix conflicts and then commit the result"]; | |
m4 [label="error: Your local changes to the following\nfiles would be overwritten by merge"]; | |
} | |
// Coluna da ação a ser tomada | |
subgraph cluster_acao_a_tomar { | |
label="Resolução"; | |
graph [color=darkseagreen1]; | |
// acoes | |
node [shape=box,style="filled,rounded",fontname=helvetica,fillcolor=gold]; | |
rc1 [label="Resolva conflitos"]; | |
rc2 [label="Resolva conflitos"]; | |
r2; | |
r3; | |
// comandos prompt | |
node [shape=signature,style="filled,rounded",fontname=mono,fillcolor=grey23,fontcolor=white]; | |
add1 [label="git add <files>"]; | |
add2 [label="git add <files>"]; | |
commit1 [label="git commit"]; | |
commit2 [label="git commit"]; | |
commita1 [label="git commit --amend"]; | |
pull1 [label="git pull origin <branch>"]; | |
pull2 [label="git pull origin <branch>"]; | |
status [label="git status"]; | |
stash [label="git stash save"]; | |
stasha [label="git stash apply"]; | |
stashc [label="git stash clear"]; | |
restore [label="git restore <files>"]; | |
restores [label="git restore --staged <staged-files>"]; | |
// perguntas prompt | |
node [shape=box,style="filled,rounded",fontname=helvetica,fillcolor=white,fontcolor=black]; | |
r4; | |
// Resolução 1 | |
// r1 [label=""]; | |
// Resolução 2 | |
r2 [label="Escreva a mensagem de commit do merge"]; | |
// Resolução 3 | |
r3 [label="Veja os arquivos conflitados - Unmergeds paths"]; | |
r3 -> status -> rc2 -> add1; | |
add1 -> commit1 [label="criar novo commit\n especifico do merge"]; | |
add1 -> commita1 [label="juntar ao último\n commit - usar em commits\n direto na develop"]; | |
// Resolução 4 | |
r4 [label="Você pode/deve\ncomitar agr?"]; | |
r4 -> add2 [label="sim"]; | |
add2 -> commit2 -> pull1; | |
r4 -> "Você pretende manter as\nmodificações nos arquivos?" [label="não"]; | |
"Você pretende manter as\nmodificações nos arquivos?" -> stash [label="sim"]; | |
stash -> pull2 -> stasha -> rc1 -> stashc; | |
"Você pretende manter as\nmodificações nos arquivos?" -> restores [label="não"]; | |
restores -> restore; | |
} | |
// Conexão entre nodes | |
e1 -> m1; | |
e2 -> m2 -> r2; | |
e3 -> m3 -> r3; | |
e4 -> m4 -> r4; | |
} |
Author
neninja
commented
Nov 28, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment