
Blinking Commits - gurraman
http://blog.annharter.com/2015/08/12/blinking-commits.html
======
svckr

        git commit -F <(curl https://raw.githubusercontent.com/thiderman/doge/master/doge/static/doge.txt) # [0]
    
    

Oh god do I feel bad about this. What have I done?

[0] [https://github.com/thiderman/doge](https://github.com/thiderman/doge)

~~~
manojlds

        git commit --allow-empty -F <(curl https://raw.githubusercontent.com/thiderman/doge/master/doge/static/doge.txt)

------
0x0
Funny timing, with the recent "Terminal escape sequence XSS" post on oss-
security in mind: [http://www.openwall.com/lists/oss-
security/2015/08/11/8](http://www.openwall.com/lists/oss-
security/2015/08/11/8)

~~~
thephyber
> So the basic TL;DR: please don't use really ancient terminal programs that
> are vulnerable to this stuff. Disappointing that he would make this
> statement and then not bother to recommend specific ones to avoid and/or
> use.

------
creshal
Regrettably (?), you can't use this to implement marquee.

But you can make your text black with a black background. Or re-order lines,
which I suspect to be "fun" for git logs.

~~~
jamie_ca
I think the most devious would be to simply move the cursor up one line. This
would result in the 'git log' line being overwritten, and hiding the commit
from casual scrutiny.

------
jamesdsadler
iTerm2 supports images in the terminal. May as well take this as far as it
will go.

[https://iterm2.com/images.html](https://iterm2.com/images.html)

Edit: even animated gifs

~~~
dmix
Ranger utilizes this well on (not just on iterm)
[http://ranger.nongnu.org/](http://ranger.nongnu.org/) \- a VIM-style
terminal-based file explorer via w3m.

~~~
rnhmjoj
Unfortunately only with iTerm2 it seems able to play animated gif.

------
rurounijones
I actually quite like the idea of control codes in commit messages for
internal teams where you can implement rules.

It could be useful for highlighting risky commits in red or other visual
markers.

Would play merry hell with almost every other way of viewing commits though :D

~~~
rudolf0
>I actually quite like the idea of control codes in commit messages for
internal teams where you can implement rules.

>It could be useful for highlighting risky commits in red or other visual
markers.

Yeah... that is really not a good idea. You are not supposed to take this blog
post seriously.

Why not just agree on some terminology like CRITICAL/MINOR/SECURITY, which a
visual interface can then highlight?

    
    
        SECURITY: Fix XSS in spline reticulation
    

If it detects "SECURITY" it adds a red background, etc. Anyone viewing the raw
text version of the commit messages will still get the message without having
to see a bunch of gibberish.

~~~
rurounijones
> You are not supposed to take this blog post seriously.

And you were not supposed to take my comment seriously... I thought I made
that obvious with the last sentence but oh well.

------
tempodox
Has nothing to do with git, or committing, it just applies VT100 control codes
that work anywhere in a compatible terminal.

~~~
thom_nic
So to be clear, the article isn't suggesting that e.g. github will interpret
the ANSI escape sequences, but they will be when you `git log` from a command
line, right?

~~~
johnmaguire2013
Correct, this is an ANSI escape code[1] interpreted by terminals, not XSS.

[1]
[https://en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code)

------
thom_nic
Anyone know if an issue has been opened (or any relevant discussion on the dev
list) on stripping escape sequences? It _does_ seem like it could be harmful.

------
catern
To insert a literal character (like the Escape entered in this post) in Emacs,
use C-q.

------
GuiA
Of course, you can also use other escape codes to make your commits colored
(e.g. [92m for green), underlined ([4m), etc.

~~~
caf
Or change the terminal title. ^[]0;title^G

~~~
LukeShu
Or for screen and tmux:

    
    
        ^[ktitle^[\

------
Cthulhu_
So, 1990's Geocities commits are now a thing again? ^[[5m#UNDER
CONSTRUCTION^[[0m

------
nichochar
The writing style is clever and funny. You should keep writing!

------
dlss
I think this post just changed my position on censorship :p

------
cousin_it
Will it still work if I omit the closing bracket? Or put it in a different
commit message, further down the page?

------
eldude
This is a really entertaining writing style: technical enlightenment through
demonstration via humorous examples. For the lazy (and additional humorous
demonstration), I wish he'd provided an example gif showing it in action
(i.e., Github, terminal, Sourcetree, etc...).

~~~
sbierwagen
The author uses female pronouns.

~~~
eldude
There are no gendered pronouns in her blog post.[1]

At first, I was surprised to find I falsely assumed she was male in spite of
evidence to the contrary, and was going to thank you for making me more aware
of my own oversight. Upon review, however, I made the correct assumption that
it was non-gendered. I'll forego the inciting comment, and corresponding
cultural political flamewar over my use of a singular default male pronoun. If
you down-voted me, please understand that doing so is alienating and a
disservice to conversations. We should not punish commenters for failing to
conform to our own personal cultural norms. This is consistent with the spirit
of your comment; engineers need not conform to external expectations of a
masculine identity.

[1] _Her_ handles at the bottom are neither pronouns, nor in the blog post,
and were inconsequential to me given my present lack of motive for reaching
out to the author.

~~~
sbierwagen
I didn't downvote you. (Downvotes are heavily rate-limited, at a guess, from
very unscientific observation, I think I only get ten a day, so I save them
for the really annoying comments.)

I'm not sure why you think he/his pronouns are nongendered. The nongendered
pronouns in English are they/them.

~~~
eldude
You're continuing to controversialize and divert from the original
conversation. That said...

> I think I only get ten [downvotes] a day, so I save them for the really
> annoying comments.

10 downvotes a day? Please reconsider your behavior. You are almost certainly
unnecessarily alienating commenters, and in this case, misguidedly so.

> I'm not sure why you think he/his pronouns are nongendered.

When I said "it was non-gendered," I was referring to _the blog post,_ which
meant your original comment, "The author uses female pronouns," is factually
incorrect.

> The nongendered pronouns in English are they/them.

I'm aware, and intimated as much: "I'll forego [discussing] my use of a
singular default male pronoun". Yes, they/them is non-gendered, but it is also
plural, making it grammatically historically incorrect. However, despite the
informality of my comment, given the extreme propensity of the "generic he" to
be controversialized, especially in technology and the internet, and the
movement away from it during my lifetime, I'll placate to avoid the negative
insinuations.

Educating yourself on the context of the matter would go a long way to
ameliorate your sanctimonious attitude, and hopefully disincline you to feel
the need to controversialize, divert and detract from conversations in the
future.

~~~
tangent128
On the matter of education, singular they is historically supported:
[https://en.wikipedia.org/wiki/Singular_they#Older_usage_by_r...](https://en.wikipedia.org/wiki/Singular_they#Older_usage_by_respected_authors)

~~~
eldude
Yes. I'm aware. I was trying to be as terse as possible on the diverting
topic. It's disputed whether past singular they was considered grammatically
correct at the time, despite the source. Of course, then you have to define
what it means to be "considered grammatically correct" and who decides that
and now you're entering a whole subjective can of worms that turns into
circular logic, leading back to the realization that language is largely
cultural and expressive, not technical, unfortunately. All of these are
reasons why there's not much room for a logical argument here, and only an
appeal to emotion, bandwagoning, and some historical bad actors making the
"generic he" untenable.

Still, the OC was factually incorrect and this entire topic is diverting and
as you've now contributed to with your sanctimonious desire to prove me wrong,
controversialized and alienating here on HN.

------
brillenfux
In the world of ANSI escape codes and terminal emulators things are never that
easy.

Works for OS X apparently.

------
im3w1l
Haha, what a coincidence. Just the other day we discussed string special
cases[0][1], to which I contributed ansi escapes. Unicode "fonts" 𝓵𝓲𝓴𝓮 𝖙𝖍𝖎𝖘
seem to work in commit messages as well.

I think this is quite harmful, especially the character movement ansi escapes
could be used for nefarious purposes.

[0]
[https://news.ycombinator.com/item?id=10035008](https://news.ycombinator.com/item?id=10035008)

[1] [https://github.com/minimaxir/big-list-of-naughty-
strings/blo...](https://github.com/minimaxir/big-list-of-naughty-
strings/blob/master/blns.txt)

~~~
icebraining
_I think this is quite harmful, especially the character movement ansi escapes
could be used for nefarious purposes._

Like what?

~~~
leni536
\- Push malicious commit

\- Rewrite the commit hash in git log with character movement

Actually I don't know if it's a practical attack in any way, could cause some
confusion.

~~~
lisivka
If you can commit, why not just enter something like "Small fix in formatting"
instead of drawing of LOT of attention to malicious comit?

------
Perceptes
This works for me in OS X's built-in Terminal app, but not iTerm. Both report
xterm-256color as $TERM, so I'm not sure what about iTerm is configured
differently to prevent it from working there.

~~~
thechriswalker
iTerm2 has an option in your Profile: Text tab > Text Rendering: "Blinking
Text Allowed"

Off by default; enable and blink like its 1989.

------
rmc
I wonder if GitHub do/will support this and parse it to HTML

~~~
MattBearman
If they did they'd have to wrap it a <blink> tag. Anything else would just be
sacrilege

~~~
chrisfosterelli
Unfortunately most browsers don't have <blink> support anymore

~~~
LukeShu
Well, then it fits; many terminal emulators don't support \e[5m as blink
anymore. Xterm, URxvt, and Konsole do, but the Linux terminal doesn't (gives
it a grey background, not blinking), VTE-based terminals (gnome-terminal,
lxterminal, ...) don't (ignored), Emacs term-mode doesn't (treats it as bold).

~~~
yuubi
The "gray background" is really a "bright black" background. The old IBM CGA
and successors had a flag for whether to interpret the top bit of the
background color as intensity or blink[0]. It looks like Linux used to have it
set to blink a few years back[1].

[0]
[http://webpages.charter.net/danrollins/techhelp/0087.HTM](http://webpages.charter.net/danrollins/techhelp/0087.HTM)

[1] [http://sourceforge.net/p/linux-
fbdev/mailman/message/7849329...](http://sourceforge.net/p/linux-
fbdev/mailman/message/7849329/)

------
erikb
Doesn't work in my gnome-terminal. Looks like the commands get escaped by git
somehow. Did anybody test it?

~~~
rquirk
Doesn't work on Xfce either. On a virtual terminal thingy (ctrl-alt-f1) it
shows a grey background with white text. I suspect blink is only implemented
on the Mac's terminal, not in Linux-land.

~~~
daveloyall
> _I suspect blink is only implemented on the Mac 's terminal, not in Linux-
> land._

...Lord, when did I get so old? :/

EDIT:
[https://en.wikipedia.org/wiki/VT100](https://en.wikipedia.org/wiki/VT100)

~~~
erikb
I suspect it's really not a terminal issue but something about git. Or does a
Terminal that doesn't interpret a command print it in clear text? I just get
the string back, the same way I entered it.

~~~
daveloyall
What?

[https://en.wikipedia.org/wiki/ANSI_escape_code](https://en.wikipedia.org/wiki/ANSI_escape_code)

It's definitely a terminal thing. The "bug" in git is that it doesn't strip
out the control characters or reject the commit if the commit message contains
non-text data.

------
DonHopkins
Who remembers when most of the blogs syndicating discussions about RSS all
started blinking at once, when somebody posted an item whose title was "What
happens when you put a <blink> tag into the title?"

------
madaxe_again
Every time I use a control character, my mind strays back to CHR$141.

Although I do wonder what havoc you could wreak on hosted git services with
cunning sequences of control characters. Smacks of injection.

~~~
alxndr
If anyone else is curious about CHR$141, it's how you can show doubly-tall
letters on an Acorn BBC Micro's teletext display...

[http://www.bbcbasic.co.uk/bbcwin/manual/bbcwinh.html](http://www.bbcbasic.co.uk/bbcwin/manual/bbcwinh.html)

[https://en.wikipedia.org/wiki/Teletext](https://en.wikipedia.org/wiki/Teletext)

------
forgotmypassw
First emojis, now blinking text, this has to stop.

------
belgianguy
Can you turn it off? I'd imagine a big project (e.g. Linux Kernel) could start
to look like a Christmas tree...

------
ins0
ok now i need a spam filter for git log - everything is flashing like "look at
my nice changes here!" :)

~~~
Cthulhu_
THIS COMMIT IS REALLY IMPORTANT!!11

~~~
leni536
YOU ARE THE 1000000th VISITOR OF THIS GIT LOG!

------
imauld
You were more concerned with whether or not you could you never stopped to
think whether or not you should

~~~
andrewflnr
Nah, they just want to watch the world burn.

------
cranium
After the emoji, the blinking... Will git commits become like the 2000s web?
:p

~~~
TeMPOraL
Wait 'till someone figures out he/she can store a webpage inside commit
message.

~~~
malka
and wait 'till someone figures out they can store ads inside commit messages.

~~~
ccozan
actually, this could be done by github for some extra buck.

------
zamalek
We just need a marquee now.

~~~
DonHopkins
I say leapfrog directly to WebGL commit messages.

------
mey
All this talk about ASCII control codes and no one mentions 0x07 aka ␇?

------
tibbon
Surely, there is a way to do this in Sublime?

~~~
XaspR8d
If you can insert the ESC character, u001B, it's easy. (Though note that it
appears as the two characters ^[ in the blog post, so your code should start
ESC[5m with only one bracket.)

Unfortunately Sublime wasn't happy with me trying to type it through the Mac
Unicode Hex input, but I _was_ able to copy-paste it in, and I was also able
to enter it directly in other programs, like GitHub desktop.

