Pull Requests directly on GitHub

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Post Reply
User avatar
NewJoker
Veteran
Posts: 2592
Joined: Sun Oct 11, 2020 7:49 pm

Pull Requests directly on GitHub

Post by NewJoker »

Hi,

when I want to make a small PR changing a few lines in a file or two (sometimes even to fix a typo), do I really have to follow the whole procedure of downloading the source code to a computer, creating a branch, making the changes locally, pushing the changes to my GitHub repository and sending a PR ? Some time ago it was possible to do it directly on GitHub for a single file (I just had to click Edit and it created a branch automatically). But now it seems to be impossible:

changes.png
changes.png (4.67 KiB) Viewed 6284 times

What's the easiest way now (possibly directly on GitHub) ? Do I have to create branches manually for each small PR ?
Syres
Veteran
Posts: 2493
Joined: Thu Aug 09, 2018 11:14 am

Re: Pull Requests directly on GitHub

Post by Syres »

NewJoker wrote: Sat Aug 05, 2023 11:00 am What's the easiest way now (possibly directly on GitHub) ? Do I have to create branches manually for each small PR ?
Yep, I noticed the same thing yesterday when I went to create a simple PR so I found the best way is to create a new branch on Github and to be honest it makes you think of a proper name rather than patch-n but it's a more convoluted process than previously.
User avatar
NewJoker
Veteran
Posts: 2592
Joined: Sun Oct 11, 2020 7:49 pm

Re: Pull Requests directly on GitHub

Post by NewJoker »

Syres wrote: Sat Aug 05, 2023 3:39 pm Yep, I noticed the same thing yesterday when I went to create a simple PR so I found the best way is to create a new branch on Github and to be honest it makes you think of a proper name rather than patch-n but it's a more convoluted process than previously.
All right, I figured it out. So each time I have to create a branch, update it, make the changes and then I can send the PR. Well, the advantage of this is that now I can make changes to more than 1 file for each PR (previously I had to make 2 PRs if 2 files were edited directly).
User avatar
onekk
Veteran
Posts: 5658
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Pull Requests directly on GitHub

Post by onekk »

NewJoker wrote: Sat Aug 05, 2023 4:07 pm ...
All right, I figured it out. So each time I have to create a branch, update it, make the changes and then I can send the PR. Well, the advantage of this is that now I can make changes to more than 1 file for each PR (previously I had to make 2 PRs if 2 files were edited directly).

Another advantage is in a philosophical optics that you will be more diligent when coding, to avoid typos and trivial errors, as the procedure for fixing is more complicate. :lol:

Same as example if you are using a "linter" during coding, after having coded something, you will see 100 and more errors, (I experience this when I edit some old code made at beginning), interesting things, code is working, but is very ugly and "bad coded", so I spend some time to clean it and then the result is that some errors now are more visible, as the linter is spotting as example:

Code: Select all

if something == False:
or similar things that are not visible in the code and probably in future Python version will raise some errors. :oops:

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
User avatar
andrecaldas
Posts: 300
Joined: Fri Jan 27, 2023 8:45 pm
Contact:

Re: Pull Requests directly on GitHub

Post by andrecaldas »

NewJoker wrote: Sat Aug 05, 2023 11:00 am [...] do I really have to follow the whole procedure of downloading the source code to a computer, creating a branch, making the changes locally, pushing the changes to my GitHub repository and sending a PR ?
[...]
What's the easiest way now (possibly directly on GitHub) ? Do I have to create branches manually for each small PR ?
I am not really sure of what I am talking about... I don't know much about git.

But maybe you can keep a "small PRs" branch in your repo. Then, every time you have a small PR, you can use this branch. After the PR has been accepted, (I believe) this branch can be reused for a new PR. You merge master (main) into it (or rebase) and produce your new PR.

The downside is that you have to wait the first PR to be accepted to submit a second PR using the same branch.

Does it make sense?
Post Reply