Reviewers are unwilling to even begin the review
Reviewers are more likely to skip vital parts of the newly-added code
It's hard/impossible to keep entire context in memory during review
Especially wrong:
Mixing refactors, features and bugfixes in a single pull request
E.g. 80% changes in a PR are refactors but 20% are bugfix- or feature-related... mixed in between the refactor changes
Reviewers are more willing to begin the review
Reviewers are less likely to skip vital parts of the newly-added code
It's much easier to keep the entire context in memory during the review
Good practice: calling branches:
Side effect: you'll end up with:
Spoiler: there are tools to handle that ;)
Not really that much important in day-to-day work...
who cares about git history
Until it starts!
Usually already months into production deployment
Linear history starts getting pretty important
when we actually do care:
What to do after applying the hotfix changes onto master?
Merge the hotfixed master into develop.
Alternative: rebase develop's history onto the hotfixed master?
NOPE! Doing so would desync commits recorded in merged PRs on GitHub (Bitbucket etc.) from the actual develop's history
Collecting various pieces of data from git log, git branch, git status?
This point applies to many other tools...
having a single dashboard with the overall big picture is better
than collecting pieces around multiple GUI panels/CLI commands
Example: Kubernetes Dashboard vs kubectl
If only there was a tool that:
A complement of IntelliJ's VCS tool window
GitHub: VirtusLab/git-machete-intellij-plugin
(git logo... cut into half)
File Settings Plugins Git Machete
Git tool window (Alt+9) 🡒 Git Machete tab
... or just Ctrl+Alt+Shift+M
Sync to parent status (edge color)
Branch name
Custom annotation
Sync to remote status
Commits uniquely belonging to the branch
Green edge
- everything is fine: child branch is in-sync with its parent (every commit belonging to the parent, belongs also to the child branch)
Red edge
- rebase required: the child branch is out-of-sync with its parent (there are commits that belong to the parent but not to the child - branches are diverged)
Gray edge
- branch was merged: the tip of the child branch belongs to the history of the parent branch - is available from the parent branch
Short text that describes the branch - a kind of comment. It can be anything (e.g. PR number).
untracked
- branch has no remote tracking branch set up
ahead of
- branch has a commit(s) not present on the remote
behind
- remote has a commit(s) not present in the local branch
diverged from
both remote and local branch have a commit(s) not present in the other branch
-
diverged from & older than
special case of "diverged from": the latest commit on the local branch is older than the latest commit on the remote branch
-
Wait, git-machete guesses what branches to list... automagically?!
And what if I still want to change it?
Everything is kept in single plain text file with ultra-minimal syntax!
.git/machete
Demo sub-agenda:
In gitspeak, to fast-forward a branch means to update the branch pointer in such a way that its new pointed commit is a direct descendant of the prior pointed commit.
In other words, the new commit is a child, or grandchild, or grandgrandchild, ... of the old commit.
Installable via:
Fun fact: just put git-X executable on PATH,
and `git X` will become available - easiest plugin system ever
Usually enough to use just the 3 subcommands:
git machete discover git machete status git machete traverse