7 msยท
Blinking Commits
- brillenfux 11y agoIn the world of ANSI escape codes and terminal emulators things are never that easy. Works for OS X apparently.
- creshal 11y agoRegrettably (?), 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.
- WalterGR 11y agoANSI control characters include cursor positioning, so in theory you could implement marquee messages. The problem would be introducing delay. I don't recall if you can do that using ANSI. You can emulate it by doing repeated cursor repositioning, but that would be rendered so quickly that the commit message would have to be enormous to include any appreciable delay.
- jamie_ca 11y agoI 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.
- deleted 11y ago[deleted]
- ins0 11y agook now i need a spam filter for git log - everything is flashing like "look at my nice changes here!" :)
- GuiA 11y agoOf course, you can also use other escape codes to make your commits colored (e.g. [92m for green), underlined ([4m), etc.
- rurounijones 11y agoI 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 11y ago>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 11y ago> 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.
- dlss 11y agoI think this post just changed my position on censorship :p
- rmc 11y agoI wonder if GitHub do/will support this and parse it to HTML
- gtremper 11y agoIts not supported currently at least. I get [5mFoo[0m
- forgotmypassw 11y agoThere's absolutely no reason for it to be ever supported.
- MattBearman 11y agoIf they did they'd have to wrap it a <blink> tag. Anything else would just be sacrilege
- chrisfosterelli 11y agoUnfortunately most browsers don't have <blink> support anymore
- LukeShu 11y agoWell, 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 11y agoThe "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...
- forgotmypassw 11y agoFirst emojis, now blinking text, this has to stop.
- nichochar 11y agoThe writing style is clever and funny. You should keep writing!
- cranium 11y agoAfter the emoji, the blinking... Will git commits become like the 2000s web? :p
- jamesdsadler 11y agoiTerm2 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
- Cthulhu_ 11y agoSo, 1990's Geocities commits are now a thing again? ^[[5m#UNDER CONSTRUCTION^[[0m
- zamalek 11y agoWe just need a marquee now.
- DonHopkins 11y agoI say leapfrog directly to WebGL commit messages.
- im3w1l 11y agoHaha, 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/blob/master/blns.txt https://github.com/minimaxir/big-list-of-naughty-strings/blo...
- icebraining 11y agoI think this is quite harmful, especially the character movement ansi escapes could be used for nefarious purposes. Like what?
- Torn 11y agoAnnoying your coworkers, for one
- fit2rule 11y agoJust yesterday I ran across this example: "(ใฃหโฝห)ใฃ :cloud: โ(โใโโ)" in the Parse SDK repo, which I found especially distracting, and in general, kind of turned me off from the project (even though I know Parse is awesome). I agree that UTF and special-chars should be permissable; I don't agree that if they don't actually communicate something, they should be used anyway. Maybe this cute 'moticon trend is trendy, but for my buck$, I'd rather things just be kept simple. My eyeballs see (ใฃหโฝห)ใฃ :cloud: โ(โใโโ) as line-noise, mostly, and make me wonder if there are other such typo's to be found in the attached code-base.
- mahouse 11y agoI personally just find the committer to be immature, nothing else.
- 11y ago
- cousin_it 11y agoWill it still work if I omit the closing bracket? Or put it in a different commit message, further down the page?
- catern 11y agoTo insert a literal character (like the Escape entered in this post) in Emacs, use C-q.
- belgianguy 11y agoCan you turn it off? I'd imagine a big project (e.g. Linux Kernel) could start to look like a Christmas tree...
- deleted 11y ago[deleted]
- 0x0 11y agoFunny 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 11y ago> 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.
- erikb 11y agoDoesn't work in my gnome-terminal. Looks like the commands get escaped by git somehow. Did anybody test it?
- rquirk 11y agoDoesn'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.
- baghira 11y agoIt does work in urxvt and konsole (and there's an option to turn it off). And as tempodox said, this is just VT100 stuff.
- marcosdumay 11y agoYou can set Xterm and Konsole to be VT100 compatible. I dunno about Gnome Terminal. Anyway, they default to "linux" for more than a decade.
- daveloyall 11y ago> 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 11y agoI 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 11y agoWhat? 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.
- injamul 11y agoplease tell me the sofware for testing
- Perceptes 11y agoThis 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.
- awendt 11y agosame here
- thechriswalker 11y agoiTerm2 has an option in your Profile: Text tab > Text Rendering: "Blinking Text Allowed" Off by default; enable and blink like its 1989.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- stupejr 11y agoDidn't downvote but just a guess: nitpicking, not adding anything of value.
- deleted 11y ago[deleted]
- tempodox 11y agoHas nothing to do with git, or committing, it just applies VT100 control codes that work anywhere in a compatible terminal.
- trampi 11y ago"XSS has nothing to do with {my website framework}, it just applies javascript that work anywhere in a compatible browser." Actually it has something to do with git. Git should strip or escape the user input before displaying. XSS and SQL Injections are the same kind of issue -> do not trust the user input and escape the input before interaction with it happens.
- tempodox 11y agoI see your point, and I agree. The OP didn't mention that aspect, but yes, git is darned crappy software, repeating stupid mistakes that are long forgotten elsewhere. Some developers don't seem to be learning from past mistakes.
- wdewind 11y ago> git is darned crappy software Let's not go crazy now.
- couchand 11y agoWhy would git strip formatting from my message? If my team wants colorful messages why should git be the one to say we're wrong? Git commit messages are used for lots of different things, but at the end of the day it's just another piece of data included in a hash in a content-addressable file system. If you're doing something with that tool where including formatting like this would be considered a vulnerability, it's on you to take care of that. It's exactly the same with any other bug or exploit in your codebase: it's not git's fault that you committed it.
- trampi 11y agoIf you need to have this feature, then you should have to opt in (git config for example). But i have very good reasons to say that the default should properly escape the messages before printing them. I would not like it to clone a repo from github and having "git log" let my terminal go crazy. You unterstand, that this issue can have bigger impact than blinking commit messages, right?
- imauld 11y agoYou were more concerned with whether or not you could you never stopped to think whether or not you should
- andrewflnr 11y agoNah, they just want to watch the world burn.
- thom_nic 11y agoAnyone 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.
- DonHopkins 11y agoWho 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 11y agoEvery 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 11y agoIf 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
- eldude 11y agoThis 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...).
- JoshM33k 11y ago(The terminal would be the only place it would display correctly it seems, but it would be nice to see the chaos it may or may not cause in Github and other tools.) Finding someone who can write very technically while also being funny and charismatic is pretty rare (We computer types aren't always the biggest hits at parties). I also really appreciate his "last time on" opening paragraphs... it gives some context to the blog post and where's coming from in his headspace. Neat.
- sbierwagen 11y agoThe author uses female pronouns.
- eldude 11y agoThere 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 11y agoI 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.
- tibbon 11y agoSurely, there is a way to do this in Sublime?
- XaspR8d 11y agoIf 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.
- svckr 11y agogit 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 11y agogit commit --allow-empty -F <(curl https://raw.githubusercontent.com/thiderman/doge/master/doge/static/doge.txt)
- mey 11y agoAll this talk about ASCII control codes and no one mentions 0x07 aka โ?