
Beginners guide to github got me through my first sheet submission. It's cookbook style steps were adequate (but improvable).
However my first update to my character sheet is a huge mess. I am wondering if maybe somebody who knows what I should be doing could maybe add a new section for an intermediate guide to github, slowly, step by step, walking a newbie through the process of updating a sheet that already exists.
If you don't mind, I will explain what I did and what seems to be wrong, what I think I might have to do, and maybe even how I think I need to do it.
I am hoping somebody can both provide guidance and correction, and in the end maybe somebody knowledgeable can update the beginners guild to include this process.
OK, so I made a bunch of changes to my character sheet html and css. When I had them how I wanted them, glanced at the main Roll20 repository, saw that, as expected, nobody else had committed any changes nor made any outstanding pull requests, so my base code was the most recent. I went to the folder on my hard drive where my own clone of the repository is stored, opened the .html file, pasted my new stuff in and saved it. Did same with .css. I opened github for windows, It told me 2 files had changed and I used the button in the lower left to "commit to master".
Then I went to menu/branch/create pull request and created a pull request. This was all pretty much a subset of stuff I had done when I first submitted the sheet and I was happy at it being so easy.
All fine so far until I saw that "This branch has conflicts that must be resolved". It says it has 223 conflicts that must be resolved! (7 in .css, 216 in html). It has flagged every single change that I made as a "conflict"! As far as I can tell, there does not seem to be a button that says "just use the new damned file", nor any buttons attached to the 'conflicts' that says ('keep the old stuff' or 'use the new stuff'). As far as I can tell (from https://help.github.com/en/articles/resolving-a-merge-conflict-on-github) it has created a brand new version of the files that is full of 'conflict markers', and I am supposed to go through that and remove all the conflict markers that it just added! along with all the code from the old version that I don't want to keep.
Now I suppose that 223 conflicts will only take about an hour, and there is at least a 50% chance that the process will not introduce any new and totally unnecessary bugs due to failing to remove again a line of code that I had previously removed, or accidentally removing a line of code that I had already told it to add, but I can't help but thinking that this is a totally and completely stupid process that is at least as likely to introduce new bugs due to unnecessary editing in the actual step of moving things into production as it is to avoid errors from branching issues. So I can't help but think that I did something wrong and there was a simple way to avoid this.
I am going to take a small digression from the character sheet, and mention that I did the exact same thing to a javascript file in the api-scripts repository pull request. It seems to think that .js files are binary files, so it says that there are differences, but will not show the differences. I pressed the "resolve conflict button" and it said warning this will commit to master. After trying various things, I said "ok", and now I can't see anything in my downstream repository. I am not certain that the "resolve conflict" button did not just blank out my downstream. Or maybe it did not, it just thinks it is binary, I have no clue. Anyway, unless pressing the resolve conflict button made it use the new .js file as the accepted one, that pull request is messed up as well. It used to be possible to look at the .js file. Now I can't. Not certain what is in it. (Note: I think I have fixed this by just committing a 2nd time. )
OK, so anyway, I have been doing some reading.
https://app.roll20.net/forum/post/5809354/slug%7D suggests that I should be creating branches, but the experts (while trying to tell him how to do that), don't really tell him how he should be managing his sheets.
https://app.roll20.net/forum/post/7051463/slug%7D does suggest having one separate branch for each sheet. Several people start to explain good branching practice, but then give up and say it is too complex a topic. Once again, would be very nice if somebody made a good cookbook wiki that has nothing but best practices.
https://app.roll20.net/forum/post/4226001/slug%7D has
The "Merge remote-tracking branch" commit is from when you updated from Roll20's "master" branch. Since your pull request is going to the same branch, all it's really doing is helping to avoid merge conflicts. (And, since the devs aren't going to spend time resolving merge conflicts, merge conflicts mean rejected PRs.)
But does not really say much about how to do that often so that merge conflicts go away. It also has a nice link to a pull request that has this comment.
You have some deleted files from other sheets. The easiest, and most consistent, way to make sure your branch is up to date is to delete your branch after I have accepted your PR. Then when you're ready to make a new one, create a new Fork, add your changes, then open the PR. That way you are always working withe the newest code.
Just to be clear, is the easiest way to create a new Fork, or a new Branch? In any case, this seems like very good advice and if it is, ought to be viable where more people can see it easier.
So anyway, what I would really love to see is some people who really know what they are doing, hash out a set of best practices, and update the beginners guide to gethub giving some cookbook style advice that will take a newbie from creating a new sheet, through multiple updates to existing sheets.
Thoughts? Volunteers?