-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a2disconf, a2dismod, a2dissite, a2enconf, a2enmod, a2ensite, a2query, apache2ctl : add French translation #5539
a2disconf, a2dismod, a2dissite, a2enconf, a2enmod, a2ensite, a2query, apache2ctl : add French translation #5539
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful. @patricedenis yours are really good PRs!! ❤️
@sbrl / @waldyrious which would work better for this PR: rebase or squash? |
Rebase is only appropriate if the commits are cleaned up to be atomic and descriptive. As they are currently, it's better to squash since there are various fix-type commits, but it's up to @patricedenis if he prefers to clean them up. We might want to edit the guidelines in case this isn't clear. |
@waldyrious : for my information : is it possible to merge several commits into single ones even when then have already be commited? |
@patricedenis as far as I know, that's exactly what squash does. Rebase on the other hand merges every single commit into master. |
@patricedenis I'm glad you asked! 🤓 So, in git, commits are immutable, which includes not only their contents, but also their metadata such as the author, message, and location in the commit graph — i.e. who their parent is. This last point means that they can't be moved around, and in general they can't be edited, combined, etc. Branches, however, can be freely moved around to point to different commits, which allows you to create the effect of "editing", "replacing" or "combining" commits. The way this works is, say you have a branch starting from
First off, let's see what a rebase is. As the name hints, a rebase is the act of "transplanting" a branch onto a different base. You could for example rebase
And the result is this:
Notice how the commits are now named B1', B2' and B3'. That's because they are copies of the original (immutable) commits, which are still around, but invisible because no branch is pointing at them. Now imagine you want to do something fancier, such as removing commit B2 from your branch. You can use an "interactive rebase" to do this. An interactive rebase allows you to interactively decide what to do with each commit of the branch, rather than copying them all automatically to the target location. Among the things you can do in an interactive rebase are removing commits, rewording their messages, combining various commits into one (this is what's called squashing!), etc. Another interesting point in the rebase operation is that you can keep the same base; that, in effect, allows you to "edit" the commits in-place. With that in mind, let's go back to the example of removing B2 from the branch. Here's what you do:
(Note how you keep the same target location — At this point, git will open a text editor (typically vim, if you haven't configured it otherwise) with text like this:
Underneath this text there will be instructions about what you can do. In this case, dropping a commit can be done by changing the word "pick" next to it to say "drop" instead. So make that edit to the file, save it and exit the editor. Git will automatically apply your instructions, resulting in this graph:
An interesting to notice is that So, these are the basics of a git rebase, and we briefly looked at what squashing is as well. This allows us to tackle what they mean in the context of merging a PR on GitHub:
If we want something fancier, the PR author needs to make an interactive rebase on their local clone of the repository, and decide which commits to reword, combine, drop, etc.; once this is done, they can push the changes, overwriting the existing commits in the PR branch, with a force-push, which should looks like this: I highly recommend that you watch the excellent video Git For Ages 4 And Up, and also play with the interactive tutorial at https://learngitbranching.js.org. These two resources will provide you with an intuitive basis from which to learn the rest of git's amazing complexity. |
whaou ! @waldyrious thank you so much for this didactic and very much detailed content. So as I understood, I have a chance to a try this process of merging my commits myself and then try to construct a PR that will need no edits from managers. Please let me try this one before merging. Again thank you very much for your feedback !! |
Of course! Just to be clear, when you force-push to this PR's branch ( Also, a good tip to keep in mind when doing this sort of history rewriting with git is to take note of the commit at the top of the branch before you make any changes (in this case, it's the latest commit in this PR, 57eab88b). That way you can always restore the original branch if something goes wrong. The good thing about git commits being immutable is precisely that once you commit a change, it's actually very hard to lose it — even though the commit may disappear from sight, as long as you have its hash, you'll be able to recover it. 😉 |
Tip: To interactively rewrite the history of the current branch, you probably want to use |
@sbrl just a nitpick, but the first argument to |
OK, I imported an ssh key to github.com so I will now be able to work from CLI, as I did not see where from the Web GUI I would be able to use the requested commands. I will then now pull my tldr's fork locally so I can work on these commits. |
That's exactly right @patricedenis 👍 |
57eab88
to
4c28fb4
Compare
Ok I think I've managed to do it. |
Looks good to me! Merger: please rebase. |
Looks great, @patricedenis! Congrats on your newly gained knowledge ;) 💪 Maybe next time we can cover how to split a commit during an interactive rebase (e.g. the link change part of Also, for the future you might want to set your local git configuration to use an email address matching the one of your GitHub account, so that the commits don't appear to be authored/committed by two different people with the same name: |
Nice to see you merging PRs again @waldyrious ;). but it would've been even nicer to see a green "waldyrious approved these changes" :D |
Don't take it for granted! 😅
Hahaha I thought about that, but since there were 2 approvals already, and I expressed my approval in my comment, I felt it wasn't needed :) But sure, why not? Next time I'll do it regardless. |
@waldyrious My mistake for #52f0413 as I melt it myself using fixup during the interactive rebase. Again thank you all for the time and the explanations @bl-ue @sbrl @waldyrious @marchersimon ! |
common/
,linux/
, etc.)