Permalink
Browse files

add highlight for new commits / branches

  • Loading branch information...
1 parent 4cc2837 commit 94e1546b6d1cfbd677ef086d59a7b4fd7b63a0d5 @MarkLodato committed Mar 9, 2010
Showing with 28 additions and 11 deletions.
  1. +4 −0 checkout-b-detached.tex
  2. +1 −1 commit-amend.tex
  3. +1 −1 commit-detached.tex
  4. +1 −1 commit-maint.tex
  5. +1 −1 commit-master.tex
  6. +19 −6 common.tex
  7. +1 −1 merge.tex
View
@@ -8,6 +8,10 @@
\branch maint -> A;
\olddetachedHEAD -> 2;
+ \begin{pgfonlayer}{HEAD}
+ \node [branch, double shadow, above right=.4cm of 2, draw=none, fill=none]
+ {};
+ \end{pgfonlayer}
\node [branch, above right=.4cm of 2] (new) {new};
\path [branch line] (new) edge (2);
\HEAD -> new;
View
@@ -6,7 +6,7 @@
% trick the code to draw the commit below instead of above
\pgfkeys{/child count/D=-1}
- \commit 4ca87 (4) -> D;
+ \newcommit 4ca87 (4) -> D;
% this is a special case, so I won't make high level commands for this
\refbelow [branch] "master" : master -> 4;
View
@@ -3,7 +3,7 @@
\begin{tikzpicture}[main]
\boundingbox
\usualsetup
- \commit 2eecb (2) -> B;
+ \newcommit 2eecb (2) -> B;
\branch master -> E;
\branch maint -> A;
\olddetachedHEAD -> B;
View
@@ -3,7 +3,7 @@
\begin{tikzpicture}[main]
\boundingbox
\usualsetup
- \commit 1800b (1) -> A;
+ \newcommit 1800b (1) -> A;
\branch master -> E;
\oldbranch maint -> A;
\branch maint -> 1;
View
@@ -3,7 +3,7 @@
\begin{tikzpicture}[main]
\boundingbox
\usualsetup
- \commit f0cec (F) -> E;
+ \newcommit f0cec (F) -> E;
\oldbranch master -> E;
\branch master -> F;
\branch maint -> A;
View
@@ -21,6 +21,7 @@
\tikzset{work/.style = {basic, fill=work!50, draw=work}}
\tikzset{commit/.style = {history, text width=2cm, minimum height=1cm}}
+\tikzset{new commit/.style = {commit, double shadow}}
\tikzset{branch/.style = {commit, fill=branch!50, draw=branch}}
\tikzset{HEAD/.style = {commit, fill=HEAD!50, draw=HEAD}}
\tikzset{old branch/.style = {commit, fill=old branch!50, draw=old branch,
@@ -32,10 +33,19 @@
\tikzset{old attached HEAD/.style = {old HEAD, minimum height=2cm}}
\tikzset{old attached HEAD label/.style = {attached HEAD label, text=black!30}}
+\tikzset{
+double shadow/.style={
+ preaction={fill=#1,transform canvas={xshift=2mm,yshift=-2mm}},
+ preaction={fill=#1,transform canvas={xshift=-2mm,yshift=2mm}},
+ },
+double shadow/.default=yellow!75,
+}
+
\tikzset{line/.style = {>=stealth', line width=1.5pt, draw=black!70,
auto=right, bend right}}
\tikzset{object line/.style = {>=stealth, line width=1.5pt}}
\tikzset{commit line/.style = {object line, color=commit}}
+\tikzset{new commit line/.style = {commit line}}
\tikzset{HEAD line/.style = {object line, color=HEAD}}
\tikzset{branch line/.style = {object line, color=branch}}
\tikzset{old HEAD line/.style = {object line, color=old HEAD}}
@@ -92,14 +102,17 @@
\node (#1) at (#2) {\LARGE$\cdots$};
\pgfkeys{/child count/#1/.initial=0}
}
-\def\commit #1 (#2) -> #3;{
- \setcounter{tmp}{\pgfkeysvalueof{/child count/#3}}
- \node [commit, anchor=west] (#2) at ($ (#3.east) + (.5,\value{tmp}) $) {#1};
- \draw [commit line] (#2) edge (#3);
+\def\commitcommon [#1] #2 (#3) -> [#4] #5;{
+ \setcounter{tmp}{\pgfkeysvalueof{/child count/#5}}
+ \node [#1, anchor=west] (#3) at ($ (#5.east) + (.5,\value{tmp}) $) {#2};
+ \draw [#4] (#3) edge (#5);
\addtocounter{tmp}{1}
- \pgfkeys{/child count/#2/.initial=0}
- \pgfkeys{/child count/#3=\value{tmp}}
+ \pgfkeys{/child count/#3/.initial=0}
+ \pgfkeys{/child count/#5=\value{tmp}}
}
+\def\commit #1 (#2) -> #3;{\commitcommon [commit] #1 (#2) -> [commit line] #3;}
+\def\newcommit #1 (#2) -> #3;{\commitcommon [new commit] #1 (#2) ->
+[new commit line] #3;}
\def\branch #1 -> #2;{\ref [branch] "#1" : #1 -> #2;}
\def\oldbranch #1 -> #2;{\oldref [branch] "#1" : #1 -> #2;}
View
@@ -15,7 +15,7 @@
\node [cancel ref, above=.2cm of E, anchor=center] {};
\oldHEAD -> old master;
- \commit f8bc5 (F) -> E;
+ \newcommit f8bc5 (F) -> E;
\branch master -> F;
\HEAD -> master;
\path [background line, bend right=15] (F) edge[-] (3);

0 comments on commit 94e1546

Please sign in to comment.