News for hackers. Stuff that matters.
Re:Why does man print "gimme gimme gimme" at 00:30? (2017) by names_are_hard on Friday October 04, 2024 @12:10PM (#41742837)
I worked on a codebase that had a special logging function with a name like NoPushLog that was just a direct wrapper of the base log function. A githook checked that this string was not in pushed code.

This solves many of the concerns raised in this thread about readability, automation, avoiding typos in the magic string.

The tricky thing you have to solve is how to push the code that defines the custom logging function, but there are solutions.

Re:Why does man print "gimme gimme gimme" at 00:30? (2017) by mattnewton on Friday October 04, 2024 @12:41PM (#41743147)
It doesn’t allow you to put that in comments, config files or other languages though like a plain text string.
Re:Why does man print "gimme gimme gimme" at 00:30? (2017) by sneak on Friday October 04, 2024 @02:22PM (#41744131)
Why wouldn’t it? Sounds like the git hook is probably just grep…
Re:Why does man print "gimme gimme gimme" at 00:30? (2017) by mattnewton on Friday October 04, 2024 @06:20PM (#41746062)
Then why have a function?
Re:Why does man print "gimme gimme gimme" at 00:30? (2017) by saagarjha on Friday October 04, 2024 @10:19PM (#41747246)
Because it distinguishes the normal logging function from the ones that are for local debugging.
Re:Why does man print "gimme gimme gimme" at 00:30? (2017) by ajb on Saturday October 05, 2024 @04:15AM (#41748434)
Because of you made a typo, you're more likely to notice than in a comment or string, because it will fail, even at build time if you're using a compiled language
Re:Why does man print "gimme gimme gimme" at 00:30? (2017) by mattnewton on Saturday October 05, 2024 @10:54AM (#41750306)
Right, but the whole point of DO NOT SUBMIT is that it doesn’t need to be in the compilation step. It can be in data files, comments, etc. You can change your syntax highlighting theme to spot the typos x (I added them with a keyboard shortcut anyways)
Re:Why does man print "gimme gimme gimme" at 00:30? (2017) by sneak on Saturday October 05, 2024 @10:35PM (#41754315)
You need to compile the code with all the debugging logging in it so it can run and print out all the “got here 3”s and so forth.