Keeping track of code changes - best method?

Started by landyvlad, March 19, 2019, 10:37:29 PM

Previous topic - Next topic

landyvlad

Can anyone suggest an efficient way of keeping track of changes done to smf files?

I'm thinking of just keeping track of what has been edited and why.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

skb

I use a (admin only) thread in which I record all the changes. New post for each change. I change the subject line every time to a more relevant / understandable / searchable one.

SMF 2.1.4 / TP 2.2.2

shawnb61

I've started my own local git repository. 

I hope to recreate all customizations/tweaks to little mods.  I want to get to the point where I can rebuild the forum completely via package manager. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

GL700Wing

I always do the following:
1.  Insert a comment explaining what I've done and why and add my initials to the end of the line (I can then search a file for my initials);
2.  If the change came about as a result of something I read on this forum (or, very occasionally, somewhere else) I include the URL of the source of the information; and
3.  Keep a copy of the original line/lines of code as comments (very important for installing/uninstalling/reinstalling mods later on);

Here's an example from ./Sources/Load.php on one of my forums.
Quote// Fix for bug in Display Additional Membergroups on Profile mod. KL
        // See https://www.simplemachines.org/community/index.php?topic=141200.msg3031487#msg3031487
        //'list_additional_groups' => $profile['list_additional_groups'],
        'list_additional_groups' => !empty($profile['list_additional_groups']) ? $profile['list_additional_groups'] : '',
Life doesn't have to be perfect to be wonderful ...

Arantor

Git repository with build tools to automate syncing from local to server. (But I have multiple sites, multiple platforms and this lets me manage patching too, mostly.)

landyvlad

Thanks all

GL700wing yep i agree with your method and that's great for individual code but I'd like to keep some master list so I easily know what files I've made manual edits to; as well.


Arantor & shawn Git repositories are well beyond me :)

skb yes but if the forum is down, so is that thread !



"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

GL700Wing

Quote from: landyvlad on March 20, 2019, 07:03:22 AM
GL700wing yep i agree with your method and that's great for individual code but I'd like to keep some master list so I easily know what files I've made manual edits to; as well.
Easy enough to do with a UNIX/Linux command ...

Quotecd ~/www/forum ; find . \( -name \*php -o -name \*css \) -type f -exec grep -l KL {} \; | sort -f
./proxy.php
./Sources/Load.php
./Sources/LogInOut.php
./Sources/ManageMembers.php
./Sources/ManageSettings.php
./Sources/Memberlist.php
./Sources/PersonalMessage.php
./Sources/Post.php
./Sources/Profile-Modify.php
./Sources/Profile.php
./Sources/Subs-Graphics.php
./Sources/Subs-Post.php
./Sources/Subs.php
./Themes/default/Admin.template.php
./Themes/default/css/admin.css
./Themes/default/css/index.css
./Themes/default/Display.template.php
./Themes/default/GenericControls.template.php
./Themes/default/index.template.php
./Themes/default/languages/Admin.english-utf8.php
./Themes/default/languages/Admin.english.php
./Themes/default/languages/ManageSettings.english.php
./Themes/default/Login.template.php
./Themes/default/ManageMembers.template.php
./Themes/default/PersonalMessage.template.php
./Themes/default/Profile.template.php
Life doesn't have to be perfect to be wonderful ...

landyvlad

I have no idea how that works or what it does....
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

GL700Wing

Quote from: landyvlad on March 20, 2019, 09:30:58 PM
I have no idea how that works or what it does....
That's OK - here's a PHP file that does the same thing.

1. Edit the file and change the value of $my_id to whatever string you use to identify your edits (eg, MKR).
2. Use the cPanel file manager to copy the file to the root/home directory/folder (ie, the same location where SSI.php and Settings.php reside) of each forum where you modify files.
3. To list the files where you've recorded details of edits open the MyFiles.php (eg, www.mywebsite.org/forum/MyFiles.php) and wait for it to display the results.




Here's the code ...

Quote<?php
$my_id = "KL";
$this_dir = getcwd();
$command = "find . \( -name \*php -o -name \*css \) -type f -exec grep -liz $my_id\[\[:space:\]\] {} \; | sort -f";
$output = shell_exec($command);
echo "List of all .php and .css files containing string \"$my_id\" in $this_dir";
echo nl2br("\n\n$output\n");
echo "Finished listing .php and .css files containing string \"$my_id\" in $this_dir";
?>
Life doesn't have to be perfect to be wonderful ...

Biology Forums

Quote from: Arantor on March 20, 2019, 03:36:47 AM
Git repository with build tools to automate syncing from local to server. (But I have multiple sites, multiple platforms and this lets me manage patching too, mostly.)

I feel that's too risky, b/c what if Github gets hacked or they change a setting (like Facebook as done in the past), where all your private information becomes public. I like the idea, but it's scary

Illori

you can have a git repo without GitHub being involved.

Arantor

Indeed, I use my VPS for that. Others use Bitbucket, others use GitLab, Gerrit, or even just Git itself can be used that way with care.

I doubt Github will hit that problem, it's not in Microsoft's interest to let that happen.

Gwenwyfar

You could also have only a local repository. So it's essentially no different than having the files stored in your computer.

This is what I do, personally.
"It is impossible to communicate with one that does not wish to communicate"

Arantor

I just have the master repository in my server so build tools can work with it and deploy things.

Gwenwyfar

Yeah, that sounds better. My setup isn't that elaborate. I still miss FireFTP auto-uploading things for me though.
"It is impossible to communicate with one that does not wish to communicate"

Arantor


GL700Wing

Quote from: Gwenwyfar on March 21, 2019, 10:04:26 AM
Yeah, that sounds better. My setup isn't that elaborate. I still miss FireFTP auto-uploading things for me though.
I'm still using FireFTP - I use a portable version of Firefox ESR and installed FireFTP as an unsigned add-on.

Alternatively, you could use Waterfox - FireFTP installs without the need to enable unsigned add-ons.
Life doesn't have to be perfect to be wonderful ...

landyvlad

GL700 wing - thank you that's awesome !


Quote from: Gwenwyfar on March 21, 2019, 09:46:54 AM
You could also have only a local repository.

With a 1 Mbps (yep one megabit per second) download and 0.22 Mbps upload speed, no that doesn't work for me ROFL
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Arantor

Um, why not? A local repository sits on your computer...

live627

Quote from: landyvlad on March 27, 2019, 03:29:23 AM
Quote from: Gwenwyfar on March 21, 2019, 09:46:54 AM
You could also have only a local repository.

With a 1 Mbps (yep one megabit per second) download and 0.22 Mbps upload speed, no that doesn't work for me ROFL
no internet required

Advertisement: