Affichage des articles dont le libellé est git. Afficher tous les articles
Affichage des articles dont le libellé est git. Afficher tous les articles

samedi 17 octobre 2015

smallest possible working commit

When coding I often have to fight my urges to change existing code too much. New way to write a function, decouple big into small ones, reorder them, rename variables, etc etc[1]. This is the artsy part of my brain trying to express ... but it's counter productive. I need another dogma, another fetish. Recently I landed on the idea of challenging myself to make the smallest possible set of changes to a piece of code in order to fix an issue. That includes not even fixing loose formatting. Anything that isn't directly and strictly necessary to resolve the problem shouldn't be done. yet.

Ergonomic and aesthetic modifications will be done in a following commit.

As mentioned in [2], Single responsibility principle applies here to.

[1] Or even working on many changes at once.
[2] http://programmers.stackexchange.com/questions/10793/when-is-a-version-control-commit-too-large

vendredi 5 avril 2013

using custom rsa key filename with github

Out of paranoia I created my keys with '.gh' as {suf,in}fix. Github documentation mention a test command:

ssh -T git@github.com

Append `-i <public-key>` and retry.

e.g:

ssh -T git@github.com -i ~/.ssh/foo.gh.pub

samedi 7 avril 2012

bash_it color generator cost me 8 seconds at login



  • trying bash_it
  • sluggish login time
  • need : bash debug using -x, set PS4
  • trace -> inspect under vim
  • discover fancy color name generator
  • perlishly lispy thing
  • large set of nested, args eating, function aggregating bits of term code on the output
  • very DSL
  • followed by a cute 30-something calls to generate a set of {,bold,underline,blah}color variables.

I may be wrong, it seems this stacking of functions is not very cheap, at least not on my VM on a core duo. When I trace the login, thousands of calls, 90% are color related, mostly identical. I feel like looking at the naive recursive Fibonacci function.

Anyway disabling colors made bash-it invisible (sic) again.

cheat url summary :

- PS4 string to see stack >>> http://wiki.bash-hackers.org/scripting/debuggingtips
- Trace, tee log a script >>> http://www.commandlinefu.com/commands/view/3310/run-a-bash-script-in-debug-mode-show-output-and-save-it-on-a-file
- Mass comment in vim >>> http://vim.wikia.com/wiki/Commenting_out_a_range_of_lines

and the original project :

- bash-it >>> https://github.com/revans/bash-it