FreeOrion

Forums for the FreeOrion project
It is currently Tue Oct 24, 2017 11:15 am

All times are UTC




Post new topic Reply to topic  [ 188 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13
Author Message
PostPosted: Sat Oct 01, 2016 9:46 am 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
Morlic wrote:
MatGB wrote:
All I wanted to do was remove a single commit from my branch.


I use
Code:
rebase -i
for that. Drop the commit and pick everything else...


The general idea is okay and what I would suggest too, but he is using master as working branch.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
PostPosted: Tue Oct 11, 2016 3:41 pm 
Offline
Dyson Forest
User avatar

Joined: Wed Aug 13, 2014 7:21 pm
Posts: 204
Location: France
I encounter a new problem when trying to edit the FR stringtable with the GitHub web interface.

Usually, here's my process to edit the FR file (way quicker than doing it with Git):

- I enter the "Edit File" page (https://github.com/freeorion/freeorion/ ... les/fr.txt)
- In the textbox, I do a right-click then "Select All"
- Right-click again and I "Paste" my local FR file content
- Commit to master

But since today, when I "Select All", it also selects the line numbers, as a part of the file content!?

Attachment:
edit_file.gif
edit_file.gif [ 9.4 KiB | Viewed 332 times ]


So, when I check the modifications ("Preview Changes"), it says that there are 12986 additions (because obviously of the line numbers selection).

I updated my web browser (FF 49.0.1) but nothing changed.

Do you have the same problem?

Thanks.

_________________
I release every updated file under the CC-BY-SA 3.0 license.


Top
 Profile  
 
PostPosted: Tue Oct 11, 2016 4:44 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12007
Location: Munich
Happening for me as well. At least on a different file... if I try to select all on the huge stringtable page, it hangs firefox until I kill the task.

You can download the file by clicking "Raw", copy-paste it wherever, and then should be able to paste back into the text entry box. Having the line numbers doesn't seem to affect pasting.


Top
 Profile  
 
PostPosted: Tue Oct 11, 2016 6:24 pm 
Offline
Dyson Forest
User avatar

Joined: Wed Aug 13, 2014 7:21 pm
Posts: 204
Location: France
Ok, thanks, it comes from GitHub then.

I found a quick fix though:

# On the "Edit" page (by clicking on the Pencil icon):

- Place the text cursor at the beginning of the file (first line, first character)
- CTRL+SHIFT+END (it will select all the file content -and still the line numbers-, and will place the cursor at the end of the last line)
- DEL on the keyboard
- It will delete everything, and place again the cursor on the first line
- CTRL+V the full file content copied from your local file
- Check the modifications with "Preview Changes"... everything is OK!

And voilà. ^^

Note: weirdly, it doesn't work by using the right-click context menu commands "Select All" then "Delete". It will delete only the first line... ??

_________________
I release every updated file under the CC-BY-SA 3.0 license.


Top
 Profile  
 
PostPosted: Fri Oct 14, 2016 10:07 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12007
Location: Munich
The merge button on the github website has changed... Should I start doing something other than merging with a merge commit?


Attachments:
File comment: merge button
merge_pull_request.png
merge_pull_request.png [ 21.45 KiB | Viewed 306 times ]
Top
 Profile  
 
PostPosted: Fri Oct 14, 2016 10:36 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4228
Location: Sol III
Hm, I'd say "rebase and merge" (the new option) should be what we use normally - Marcel?


Top
 Profile  
 
PostPosted: Sat Oct 15, 2016 9:36 am 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3249
I think it'll depend on the PR—Squash and Merge is good for small(ish) PRs that contain, say, a "typo fix" commit or similar, I use it a lot as most of my reviews are for scripting stuff where a single commit that I've written in main is better.

I'm assuming the bottom rebase option will merge the commits in themselves without a merge message, so they'll each standalone and thus ideally need well written commit messages. And I'm also assuming the top option is merge-as-is, which I've never liked but is better if/when we merge in a fairly big project that has a lot of commits over time, a summary commit at the top explaining the main changes is easier, especially as users of Test releases need to rely on the recent commits list to know what they're meant to be looking for test wise.

So I'd say preference should be for squash and merge or rebase, but occasionally a merge commit would be better.

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Sat Oct 15, 2016 4:37 pm 
Offline
Programmer

Joined: Mon Feb 29, 2016 8:37 pm
Posts: 195
Merge and Commit for any PRs with more than one commit.
Rebase and merge for PRs that are already a single commit.

My reasons, are that the other options destroy information that is useful when debugging.

Squash and Merge
Squash and merge destroys context information in the multiple commits of a PR. If squashing the commits would make it easier to follow, then it should have been done in the PR before the merge.

As my current PRs make clear multiple commits make a PR easier to review. It also makes it easier to find and fix bugs after they are merged to master. It easier to find bugs if git-blame leads you to a focused commit where it is obvious what the original dev's intent was and how it is interacting poorly with the current code. Sometimes it is unclear because of subsequent changes in the code that couldn't be anticipated or caught in the original PR review.

Rebase and Merge
Rebase and merge destroys all of the branching information and folds all of the commits back into a linear commit history.
Rebase and merge makes the entire commit history look like old school CVS, giving up all of the post merge benefits of branches. It does not change the dates of the commits, so all commits of the merged branch and all other branches will be mixed in together.

github does not present the branching information prominently (or well), but many other tools do. To see the branching information in git bug click Graphs->Network and you can see where/when a PR was branched and where/when it merged. Again this is useful in debugging, because one PR is probably a series of related changes and seeing them in order allows you to see where things went wrong. Rebase and merge prevents this kind of debugging by destroying all of the branching information.

Rebase and merge is appropriate for small single commit PRs, like the commits that devs directly rebase and push onto master currently. The merge message would not have added any additional useful information to the commit record.,

Create a merge commit
This is the best option.

It keeps all of the branching information. Even if the original commits are over several weeks/months they are collected together. The arc of development is visible using most git tools and in github with Graphs->Network.

Having a merge message ties the whole PR together providing context for all of the changes as a set. We might consider asking contributors to include a merge message in their PR, or just use the initial PR message. Then the message is most like correct and not an additional burden on the merging dev.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 188 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group