Flyounet : (Digital|Real)? life

Une sorte de journal quotidien, mais en vachement plus espacé dans le temps

And what will happen if Github had bugs

Rédigé le . Édité le .

I'm currently working on a project (hosted on github), and facing a bug on this platform.

Edit02-Start 25/03/2016@09:15 : The Github support just answered :

The Github answer :

A real polite answer with all the explanations. They could have not answered, but they did and, now, I feel sorry to have disturb them.
Thanks Ivan for your answer.

If we read the following lines :

v) echo -e "${0} v${VERSION} [$Format:%h]\nbaker © taylorchu(2013-2015) & Flyounet(2015-2016)\n" ; exit 0;;
w) [[ -d "${OPTARG}" ]] && __w="$( cd ${OPTARG}; pwd)/";;

As you could see, I use the $Format:%h$ syntax. But as you should have noticed, I forget the $ at the end, so git looks for the dollar sign, which is on the line after.

My advice for myself : Read your code, read it twice, and when it's done, do it another time.

Edit02-End

The project

I enjoy coding for this little project : baker
It's a Static Site Generator built with Bash (*n*x tools) and Perl (for the Markdown processor).

Its main features are :

  • Template usage,
  • Recursive template usage,
  • Tags,
  • RSS & Atom generator,
  • ...

The site, you're currently viewing is built using baker.

The bug

I wrote to Github to inform them. But for the time being no return.

Content of the archive.zip file for master branch is corrupted.
Yes, in a Shell script when a dollar is missing before a variable name, we could say it's corrupted.

How to reproduce

  • Clone the repository
  • Check the line 757 of the baker file
  • Download the archive.zip
  • Unzip and check the line 757...

Demo

Some commands have ouptut in French.

Clone the repository (it's easy)

$ git clone https://github.com/Flyounet/baker
Clonage dans 'baker'...
remote: Counting objects: 1264, done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 1264 (delta 7), reused 0 (delta 0), pack-reused 1242
Réception d'objets: 100% (1264/1264), 2.37 MiB | 24.00 KiB/s, fait.
Résolution des deltas: 100% (701/701), fait.
Vérification de la connectivité... fait.

Check the Version downloaded and the line 757

$ git branch -vv
* master 3a06d0b [origin/master] Release 1.1.3 Markown parsed for Summary. Color for list.

$ nl -ba baker | grep 757
   757                          w) [[ -d "${OPTARG}" ]] && __w="$( cd ${OPTARG}; pwd)/";;

The master branch commit is 3a06d0b.

Get the archive.zip

$ wget https://github.com/Flyounet/baker/archive/master.zip
--2016-03-24 09:51:46--  https://github.com/Flyounet/baker/archive/master.zip
Résolution de github.com (github.com)… 192.30.252.131
Connexion à github.com (github.com)|192.30.252.131|:443… connecté.
requête HTTP transmise, en attente de la réponse… 302 Found
Emplacement : https://codeload.github.com/Flyounet/baker/zip/master [suivant]
--2016-03-24 09:51:52--  https://codeload.github.com/Flyounet/baker/zip/master
Résolution de codeload.github.com (codeload.github.com)… 192.30.252.163
Connexion à codeload.github.com (codeload.github.com)|192.30.252.163|:443… connecté.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : non indiqué [application/zip]
Sauvegarde en : « master.zip »

master.zip                 [                                        <=>                ] 653,38K  10,8KB/s   ds 59s    

2016-03-24 09:52:53 (11,1 KB/s) - « master.zip » sauvegardé [669066]

Unzip and check the archive version

$; unzip master.zip 
Archive:  master.zip
3a06d0b9f1ce977267ccf59674393d383a6cabf3
   creating: baker-master/
  inflating: baker-master/LICENSE.txt  
[... deleted ...

The zip archive is 3a06d0b9f1ce977267ccf59674393d383a6cabf3. We could suppose it's the same as in the clone.

Edit01-Start 24/03/2016@22:39 : As someone asked me, I also try and check the commit zip with the same result :
https://github.com/Flyounet/baker/archive/3a06d0b9f1ce977267ccf59674393d383a6cabf3.zip
Edit01-End

Check the line 757

$ nl -ba baker-master/baker | grep 757
   757                          w) [[ -d "{OPTARG}" ]] && __w="$( cd ${OPTARG}; pwd)/";;

Do you see it ?!

$ diff baker baker-master/baker 
756,757c756,757
<                       v) echo -e "${0} v${VERSION} [$Format:%h]\nbaker © taylorchu(2013-2015) & Flyounet(2015-2016)\n" ; exit 0;;
<                       w) [[ -d "${OPTARG}" ]] && __w="$( cd ${OPTARG}; pwd)/";;
---
>                       v) echo -e "${0} v${VERSION} [3a06d0b]\nbaker © taylorchu(2013-2015) & Flyounet(2015-2016)\n" ; exit 0;;
>                       w) [[ -d "{OPTARG}" ]] && __w="$( cd ${OPTARG}; pwd)/";;

Is it more clear ? The dollar sign disappear before the first {OPTARG}.

I use the contact page to inform Github, and wait for their answer.

The question

So many projects use the Github site to promote their work.
How to check all this projects ? How to know if Github is not doing the same ugly things that did Sourceforge ?
How to detect this kind of Bug ?