Skip to content
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

Merge histories with gist #1

Open
thaliaarchi opened this issue Aug 10, 2021 · 1 comment
Open

Merge histories with gist #1

thaliaarchi opened this issue Aug 10, 2021 · 1 comment

Comments

@thaliaarchi
Copy link

thaliaarchi commented Aug 10, 2021

I think it would be helpful if this repo and the gist were merged together. With this repo alone, it looks like a suspicious binary with unreadable Whitespace source, while the gist has readable source and an assembler to generate whitelie.ws. Combined, it provides the full picture.

I've rebased the two together at wspace/keen-whitelie-whitespace, ordering commits according to commit times to have a cohesive history.

If you would like to make this change, you can force push the history from my repo to here.

For reference, here are the git rebase and git filter-repo commands I used (rebase requires manual steps, so it can't be run fully automatically):

merge_repos.sh
#!/bin/sh -e

git clone https://github.com/KeenS/whitelie
git clone https://gist.github.com/KeenS/6081b0c802a4e575ddbacb1930680870 whitelie-aux

# Fix author dates to match committer dates
git -C whitelie filter-repo --commit-callback '
  commit.author_date = commit.committer_date'
# Adjust UTC times from GitHub Gist to +0900
git -C whitelie-aux filter-repo --commit-callback '
  commit.author_date = re.sub(br"\+0000", b"+0900", commit.author_date)
  commit.committer_date = re.sub(br"\+0000", b"+0900", commit.committer_date)'

git -C whitelie branch -m master main
git -C whitelie-aux branch -m master main

cd whitelie
git remote add aux ../whitelie-aux
git fetch aux
git merge --allow-unrelated-histories --no-edit aux/main

git log --format='%ad %h %s' --date=iso8601
# 2021-08-07 22:57:55 +0200 ba3fe69 Merge remote-tracking branch 'aux/main'
# 2020-04-02 09:27:41 +0900 ef7f438 fix a bug of program size calcuration
# 2020-04-02 09:24:44 +0900 f1c5d46
# 2020-04-02 00:19:19 +0900 7b9d613 add README
# 2020-04-02 00:16:39 +0900 e380295 add copying
# 2020-04-01 23:52:26 +0900 a4885a5
# 2020-03-31 23:46:45 +0900 419aa00 create it

git rebase -i --root --empty=drop
# From:
#   pick 419aa00 create it
#   pick e380295 add copying
#   pick 7b9d613 add README
#   pick ef7f438 fix a bug of program size calcuration
#   pick a4885a5
#   pick f1c5d46
# To:
#   pick 419aa00 create it
#   reword a4885a5
#   pick e380295 add copying
#   pick 7b9d613 add README
#   pick f1c5d46
#   squash ef7f438 fix a bug of program size calcuration
#
# Reword a4885a5 as "add assembler and copying"
# Accept f1c5d46+ef7f438 squashed message as-is

# Repair committer info changed by rebase
git filter-repo --commit-callback '
  commit.committer_name = commit.author_name
  commit.committer_email = commit.author_email
  commit.committer_date = commit.author_date'

git log --format='%ad %h %s' --date=iso8601
# 2020-04-02 09:24:44 +0900 11673cf fix a bug of program size calcuration
# 2020-04-02 00:19:19 +0900 f7d120c add README
# 2020-04-01 23:52:26 +0900 a373ecd add assembler and copying
# 2020-03-31 23:46:45 +0900 419aa00 create it
@KeenS
Copy link
Owner

KeenS commented Aug 21, 2021

Thank you for your suggestion. However, I'm not willing to add commit to this repo anymore. Sorry.
I'm going to leave this issue open so that others can easily access your work. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants