!BmAgWlfcrgaRfViMVl:matrix.org

Sygnal

75 Members
Sygnal is a reference Push Gateway for Matrix. #sygnal:matrix.org. Github https://github.com/matrix-org/sygnal22 Servers

Load older messages


SenderMessageTime
13 Apr 2021
@callahad:matrix.orgcallahadSince it implicitly mixes your changes with the upstream changes20:51:53
@callahad:matrix.orgcallahad So there's a bit of... manual pruning / gardening that's just become a customary part of using Git. It shouldn't be necessary (cf. my allusion to former Git competitors like Darcs and Mercurial), but Git + GitHub won, and so here we are 😆 20:53:33
@shayshay:matrix.orgShay
In reply to @callahad:matrix.org
So there's a bit of... manual pruning / gardening that's just become a customary part of using Git. It shouldn't be necessary (cf. my allusion to former Git competitors like Darcs and Mercurial), but Git + GitHub won, and so here we are 😆
Well and I'm in that weird spot where I have enough knowledge to make things happen but not enough to know exactly what I am doing....
20:56:31
@shayshay:matrix.orgShayOkay given all this I am going to try and rebase my fork and see if I can't get it current with sygnal: master. 20:57:49
@callahad:matrix.orgcallahadI can't seem to find a good tutorial / visualization, so I'll type out some more words here and feel free to tell me to stop if it's not useful21:00:08
@shayshay:matrix.orgShayno it's all helpful!21:00:23
@reivilibre:librepush.netreivilibre
In reply to @shayshay:matrix.org
Ah so when i pulled the upstream repository and merged it i should have used git pull --ff-only rather than pulling and then merging it?
I might be wrong, but I thought merge always creates a merge commit. When you're trying to make your branch the same as the remote one, creating new commits locally is a bit counter-productive :)
21:01:50
@reivilibre:librepush.netreivilibre I think it's easier in general just to do git pull 21:03:01
@callahad:matrix.orgcallahad https://learngitbranching.js.org/ looks like it might be OK 21:09:17
@shayshay:matrix.orgShay
In reply to @callahad:matrix.org
https://learngitbranching.js.org/ looks like it might be OK
i'll take a look!
21:10:57
@callahad:matrix.orgcallahad Shay: Would you want to hop on a call real quick? I think I found a decent way to show what's up . 21:11:32
@shayshay:matrix.orgShay
In reply to @callahad:matrix.org
Shay: Would you want to hop on a call real quick? I think I found a decent way walk to show what's up .
sure thing!
21:11:57
@callahad:matrix.orgcallahad https://jitsi.riot.im/callahad 21:12:11
@callahad:matrix.orgcallahad * https://jitsi.riot.im/callahad 21:29:29
@callahad:matrix.orgcallahad * Shay: Would you want to hop on a call real quick? I think I found a decent way to show what's up . 21:29:41
@shayshay:matrix.orgShayfixed it y'all thanks so much!21:38:09
@callahad:matrix.orgcallahad

TL;DR:

  • Generally speaking, avoid committing to your local copy of the master branch.
  • Use git pull --ff-only to avoid automatically creating merge commits when a branch you're working on diverges from upstream.
  • It's a best practice to use separate branches for each feature you work on: e.g., git switch master then git switch -c my-feature to create a new branch based off of master. If you're waiting for that to be reviewed and want to work on something else in parallel, just git switch master then run git switch -c another-feature to create another "feature branch."
21:39:29
@callahad:matrix.orgcallahad *

TL;DR:

  • Generally speaking, avoid committing to your local copy of the master branch.
  • Use git pull --ff-only to avoid automatically creating merge commits when a branch you're working on diverges from upstream.
  • It's a best practice to use separate branches for each feature you work on: e.g., git switch master then git switch -c my-feature to create a new branch based off of master. If you're waiting for that to be reviewed and want to work on something else in parallel, just git switch master then run git switch -c another-feature to create another "feature branch."
21:39:49
@callahad:matrix.orgcallahad

Also:

  • If you do accidentally create a merge commit, you can undo it with git reset --hard commit where commit is the thing you want to reset to (e.g., the hash of your last commit before the merge). Be careful, as this discards your local changes and resets the local copy of your current branch to the commit specified. For example, if you want to nuke all of your master and make it equivalent to upstream, then run git switch master followed by git reset --hard origin/master
  • If you want to move commits somewhere else in the tree (like to put them on top of a diverging branch to make history linear) you can use git rebase target where target is something like origin/master or origin/feature-branch-name. Be careful with this one, too, as it only changes your local copy of the branch, which can make things confusing if you've shared your changed with other people, e.g. in a GitHub pull request, since suddenly there will be disagreement between clones of the repo about what changes should fall under which branch name.
21:42:10
@callahad:matrix.orgcallahad *

Also:

  • If you do accidentally create a merge commit, you can undo it with git reset --hard commit where commit is the thing you want to reset to (e.g., the hash of your last commit before the merge). Be careful, as this discards your local changes and resets the local copy of your current branch to the commit specified. For example, if you want to nuke all of your master and make it equivalent to upstream, then run git switch master followed by git reset --hard origin/master
  • If you want to move commits somewhere else in the tree (like to put them on top of a diverging branch to make history linear) you can use git rebase target where target is something like origin/master or origin/feature-branch-name. Be careful with this one, too, as it only changes your local copy of the branch, which can make things confusing if you've shared your changed with other people, e.g. in a GitHub pull request, since suddenly there will be disagreement between clones of the repo about what changes should fall under which branch name.
21:44:08
@reivilibre:librepush.netreivilibre one more to add is that git rebase master (or git rebase origin/master) is very useful when you're on a feature branch and you want to integrate the latest changes from master into your feature branch 21:48:45
@reivilibre:librepush.netreivilibrewish I had the diagrams all drawn out somewhere to show21:49:13
@callahad:matrix.orgcallahad Yep. I'm pretty happy with git fetch origin then git rebase origin/master as a workflow... but once you've submitted your pull request then updating it requires git push --force to overwrite the previous history in the pull request 21:52:39
@callahad:matrix.orgcallahadAnd lots of people don't like that for whatever reason (GitHub's UI can make it hard to iteratively review complex pull requests if they get rebased)21:53:14
@callahad:matrix.orgcallahad * And lots of people don't like that for whatever reason (GitHub's UI can make it hard to iteratively review complex pull requests if they get rebased)21:53:32
@reivilibre:librepush.netreivilibre
In reply to @callahad:matrix.org
Yep. I'm pretty happy with git fetch origin then git rebase origin/master as a workflow... but once you've submitted your pull request then updating it requires git push --force to overwrite the previous history in the pull request
I learned something new now (about using git fetch origin which I guess I could have figured out :))
21:54:26
@callahad:matrix.orgcallahad The alternative is to merge in the upstream changes (git fetch origin then git merge origin/master), which interleaves your changes with merge commits reconciling your branch with upstream... it's more "things" in the graph, but it keeps the history stable. 21:55:17
@callahad:matrix.orgcallahad
In reply to @reivilibre:librepush.net
I learned something new now (about using git fetch origin which I guess I could have figured out :))
git pull is just sugar for git fetch followed by git merge, so I've slowly drifted toward separating them in my usage for whatever reason. Makes it more explicit when I want things to change 🙂
21:56:53
@shayshay:matrix.orgShayThanks for all this it's very helpful! 21:59:02
@_neb_github_=40reivilibre=3alibrepush.net:matrix.orgGithub [@reivilibre:librepush.net] [matrix-org/sygnal] callahad closed pull request #215: Connection Timeout Error [closed] - https://github.com/matrix-org/sygnal/pull/215 22:16:39

There are no newer messages yet.


Back to Room List