View Single Post
Old November 7, 2019, 02:10   #10
Marco
Rookie
 
Marco's Avatar
 
Join Date: Oct 2019
Location: Italy
Age: 59
Posts: 7
Marco is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
I also suggest stsrting with an unmodified branch, and rename the files you started from so we can see your changes. Right now, it is very hard to figure out what you have done.
I agree with you. I understand that dev team and the maintainer need to fully evaluate if the changes are desirable/reliable or not.
I had already chosen to separate this refactoring in two phases, the first to reorganize the code between the source files (2^ and 4^ bullet of my original post), with minimal changes to the code, and the second to review the activation of the parsers by the init modules (1^ and 3^ bullet). But the first phase is quite tricky.

Quote:
Originally Posted by Pete Mack View Post
$ git mv monster-init.c init-monster.c
...
$ git commit
$ git checkout init-monster.c
....
Thanks for the snippet. Sorry, but I used the GitHub Desktop to commit all the changes as a whole, because I am still very confused by the git terminology and commands. It's time for me to study this, I see. Every moment I'm afraid of making mistakes.

In this first phase, I need to mv two sourcefiles (mon_ & obj_init.c), deleting the respective .h, and create three others new init-xxx.c, then copy the code of some file_parsers in the new destinations and delete it from the old. In this process, some other changes are required, and I will do my best to keep them at the minimum, even if my editor discards the whitespaces at EOL. I plan to keep only one single init.h, the same way there is only a single cmds.h. I would like to incorporate hint.h into store.h and then delete it, but this is not strictly necessary.

How can I do all that? It's not only a matter of bare git commands syntax knowledge, but how I can use them to better clarify what I'm doing. Maybe I missed some guidelines, my fault.

I can undo my current commit and restart anew? I can mv and rm in a single pass the above files, then issue one commit? Then I can create the new files, move the code, modify the makefiles and finally issue another commit? I think I can group the commits in a single pull request.
__________________
/*
* Don't let the perfect be the enemy of the good
*/

Last edited by Marco; November 7, 2019 at 02:15.
Marco is offline   Reply With Quote