It has been a long time since I blogged. Unfortunately Semester End Exams played a spoiler initially due to which I lost the touch of blogging. Immediately after the exams since my Summer of Code project's progress was quite slow and not upto the mark schedules became quite hectic. With one more week to go things have been more hectic, but still I thought I should share this one with everyone. This also serves as a log of what happened to me today for myself.
I share with you the most stupid thing I ever did in life today. Free Software people i.e Free Software developers always keep saying, "Commit Early, Commit Often". I usually thought "What non-sense? How can I commit the code that either does not do the things as expected fully or is neat enough? My mentor also used to stress on committing early and often. But all these things used to fall on my deaf ears. And I almost never followed. Because of this reason I had not committed the code for around last 10 days. I had decided to commit it today. But fortunately I used to keep a backup of the code I wrote in Hurd in GNU/Linux every night before I slept.
Usually during the entire period of Summer Of Code, I used to start coding only from the afternoon hours(4 PM or so) till late in the mid-night (3:30 or so). But since this is the last week and there are lots of things to be done I decided to work even in the morning hours for this week. Today I had done quite a bit of coding, say around 100-150 lines and most of the code was written in a single file, viz. procfs_nonpid_files.c. There was a power failure for sometime and I took a break for Lunch and so. I came back again in the evening at 5:00 PM or so. There were quite a few friends online and I thought of chatting with them for sometime and check my mails along. Well, after checking the mails I started Hurd in qemu to resume my day's work and kept on chatting with my friends in the other window. After I wrote a small amount of code I felt the code needs to be copy-pasted to another file. Since I use nano on Hurd I am not quite comfortable in copy-pasting between files on Hurd. So I thought of copying the files I wanted to copy-paste the code between to GNU/Linux through NFS (Network File System). One was the file I mentioned above and the other file was named procfs_pid_files.c. I had named my NFS folder on Hurd as "nfs" in the HOME directory.
So the copy command would obviously be
cp procfs_pid_files.c procfs_nonpid_files.c ~/nfs
But since I was chatting when I just typed
cp procfs_pid_files.c procfs_nonpid_files.c
one of my friends sent a message and we were discussing about the day's hot topic, obviously India winning the first individual Gold in its history. What a man Abinav Bindra is? and related things. So I was pretty curious to know what my friend said and anxiously pressed enter and switched the window but there was nothing curious and I turned back to qemu and to my horror it was then I realized I had copied procfs_pid_files.c on to the procfs_nonpid_files.c, the file on which I had worked a lot from morning.
Most unfortunate part was that, the code I had written that morning was working. I had put so much of thinking to get things to work. But I had kept things there without committing thinking I would commit all together tonight after getting few more things working. Bah, what new things can I get? I have to redo every thing I had done from morning. I felt so sad and quite bad for my carelessness for a second which cost me so much. I immediately took a backup of other files. Fortunately I had yesterday' backup for that file, I took that and I again did all the work. It took almost the rest of the day to get things back to work again. As soon as I did that I committed the code and pushed it to the repository.
Today I learnt a very good lesson and now I understand why people say "Commit Early, Commit Often"
-- Yours affectionately,