-
Notifications
You must be signed in to change notification settings - Fork 39
Rewriting git history
Peter Trifanov edited this page Jul 28, 2020
·
12 revisions
Idea: remove all commits related to ktlint, create clean history only for diktat.
- Create forks and archives of current repo
- Merge all pull requests
- Using
git fast-export
andgit filter-repo
clean history- Count LOC and commits to make sure everything looks reasonable
- Change names and email of all contributors to appropriate ones
- Reword and squash some commits
- Force push updated repo
- All developers should perform fresh clone
- Checked out f899417baf9df13d39963a2a007f10f96e9ba2a5
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh$ cloc *
216 text files.
206 unique files.
17 files ignored.
github.com/AlDanial/cloc v 1.82 T=0.32 s (637.1 files/s, 45875.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Kotlin 180 1259 1355 7569
Markdown 7 536 0 1727
YAML 2 14 11 789
Maven 4 19 5 738
JSON 7 0 0 417
Java 1 6 8 49
SVG 1 0 1 43
-------------------------------------------------------------------------------
SUM: 202 1834 1380 11332
-------------------------------------------------------------------------------
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh$ git rev-list --all --count
1104
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh$ git fast-export master~99..master | (cd .. && mkdir diktat-petertrr-fresh-truncated &&
cd diktat-petertrr-fresh-truncated && git init . && git fast-import && git checkout)
Initialized empty Git repository in /home/pwx5333130/Documents/diktat-petertrr-fresh-truncated/.git/
/usr/lib/git-core/git-fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 4062 ( 1556 duplicates )
blobs : 1309 ( 0 duplicates 918 deltas of 1303 attempts)
trees : 2588 ( 1556 duplicates 826 deltas of 2120 attempts)
commits: 165 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1048576 ( 1474 unique )
atoms: 569
Memory total: 2446 KiB
pools: 2133 KiB
objects: 312 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2477
pack_report: pack_mmap_calls = 112
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 2307487 / 2307487
---------------------------------------------------------------------
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh-truncated$ cloc *
216 text files.
206 unique files.
17 files ignored.
github.com/AlDanial/cloc v 1.82 T=0.71 s (286.3 files/s, 20616.1 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Kotlin 180 1259 1355 7569
Markdown 7 536 0 1727
YAML 2 14 11 789
Maven 4 19 5 738
JSON 7 0 0 417
Java 1 6 8 49
SVG 1 0 1 43
-------------------------------------------------------------------------------
SUM: 202 1834 1380 11332
-------------------------------------------------------------------------------
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh-truncated$ git rev-list --all --count
165
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh-truncated$ git filter-repo --force --invert-paths --path-regex 'ktlint(?!-ruleset-huawei).*' --path-regex 'gradle.*' --path-regex 'jitpack\.yml'
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh-truncated$ git rev-list --all --count
162
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh-truncated$ cat mailmap
<[email protected]> <[email protected]>
petertrr <[email protected]>
kentr0w <[email protected]> Denis Kumar <[email protected]>
kentr0w <[email protected]> kentr0w <[email protected]>
kentr0w <[email protected]> Denis Kumar <[email protected]>
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh-truncated$ git filter-repo --mailmap mailmap
pwx5333130@LAPTOP-N7OVNE0V:~/Documents/diktat-petertrr-fresh-truncated$ git shortlog -sne
90 akuleshov7 <[email protected]>
52 petertrr <[email protected]>
18 kentr0w <[email protected]>
1 Yegor Bugayenko <[email protected]>
1 Yegor Bugayenko <[email protected]>