Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Note that in the this gist assumes that the following git aliases are in place:
- ```
- show-graph = log --graph --abbrev-commit --pretty=oneline
- co = checkout
- br = branch
- cm = commit
- st = status
- rb = rebase
- cp = cherry-pick
- lol = log --oneline
- ```
- Clone the original repo
- ```
- [ericloots@Eric-Loots-MBP] $ git clone git@github.com:typesafe-training/advanced-akka-java.git
- Cloning into 'advanced-akka-java'...
- X11 forwarding request failed on channel 0
- remote: Counting objects: 322, done.
- remote: Compressing objects: 100% (2/2), done.
- remote: Total 322 (delta 10), reused 10 (delta 10), pack-reused 310
- Receiving objects: 100% (322/322), 61.78 KiB | 0 bytes/s, done.
- Resolving deltas: 100% (101/101), done.
- [ericloots@Eric-Loots-MBP] $ cd advanced-akka-java/
- ```
- The commit history looks as follows (note that there's a `Base template` commit that is of no use to us):
- ```
- [ericloots@Eric-Loots-MBP] $ git lol
- ea24155 Data replication
- 7a555c2 Persistent actors
- da6d3b3 Cluster sharding
- ac2b3b6 Cluster singleton
- ef203f3 Cluster aware routers
- a421b58 Cluster events
- ee340ba Remoting
- 8a98458 Complete initial state
- a2391cc Initial state (koan:initial)
- 90e6a83 Base template
- ```
- Squash commits `Initial state (koan:initial)` and `Base template` together:
- ```
- [ericloots@Eric-Loots-MBP] $ git rebase -i --root
- [detached HEAD 2438ab4] Initial state (koan:initial)
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 11:25:04 2015 +0200
- 32 files changed, 2327 insertions(+)
- create mode 100644 .gitignore
- create mode 100644 LICENSE
- create mode 100644 README.md
- create mode 100644 build.sbt
- create mode 100644 man.sbt
- create mode 100644 project/build.properties
- r 2438ab4 Initial state (koan:initial)
- create mode 100644 project/plugins.sbt
- create mode 100644 shell-prompt.sbt
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/BaseApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Game.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/GameEngine.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/GameEngineApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/PlayerRegistry.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/PlayerRegistryApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/RandomPlayer.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/ScoresRepository.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/ScoresRepositoryApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Settings.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/SharedJournalApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/SimplePlayer.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Terminal.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Tournament.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Utils.java
- create mode 100644 src/main/resources/application.conf
- create mode 100644 src/main/resources/logback.xml
- create mode 100644 src/test/java/com/typesafe/training/akkacollect/GameTest.java
- create mode 100644 src/test/java/com/typesafe/training/akkacollect/TournamentTest.java
- create mode 100644 src/test/java/com/typesafe/training/akkacollect/UtilsTest.java
- create mode 100644 src/test/resources/README.md
- create mode 100644 src/test/resources/logback-test.xml
- create mode 100755 tags
- create mode 100755 verify
- Successfully rebased and updated refs/heads/master.
- /lbt/AAJ/advanced-akka-java
- [ericloots@Eric-Loots-MBP] $ git lol
- 1f19cf6 Data replication
- 3cad7ca Persistent actors
- c2bb835 Cluster sharding
- d5091f5 Cluster singleton
- 136b7d3 Cluster aware routers
- 0ecb79f Cluster events
- 05fe4ec Remoting
- 01f0d30 Complete initial state
- 2438ab4 Initial state (koan:initial)
- ```
- Change the commit messages for the resulting 8 commits to hold the respective exercise names (using the `studentify` naming conventions)
- ```
- [ericloots@Eric-Loots-MBP] $ git rebase -i --root
- [detached HEAD 6c60eea] exercise_000_initial_state
- exercise_002_remoting
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 11:25:04 2015 +0200
- 32 files changed, 2327 insertions(+)
- create mode 100644 .gitignore
- create mode 100644 LICENSE
- create mode 100644 README.md
- create mode 100644 build.sbt
- create mode 100644 man.sbt
- create mode 100644 project/build.properties
- create mode 100644 project/plugins.sbt
- exercise_004_cluster_aware_routers
- create mode 100644 shell-prompt.sbt
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/BaseApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Game.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/GameEngine.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/GameEngineApp.java
- exercise_005_cluster_singleton
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/PlayerRegistry.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/PlayerRegistryApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/RandomPlayer.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/ScoresRepository.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/ScoresRepositoryApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Settings.java
- exercise_006_cluster_sharding
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/SharedJournalApp.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/SimplePlayer.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Terminal.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Tournament.java
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/Utils.java
- create mode 100644 src/main/resources/application.conf
- exercise_007_persistent_actors
- create mode 100644 src/main/resources/logback.xml
- create mode 100644 src/test/java/com/typesafe/training/akkacollect/GameTest.java
- create mode 100644 src/test/java/com/typesafe/training/akkacollect/TournamentTest.java
- create mode 100644 src/test/java/com/typesafe/training/akkacollect/UtilsTest.java
- create mode 100644 src/test/resources/README.md
- exercise_008_data_replication
- create mode 100644 src/test/resources/logback-test.xml
- create mode 100755 tags
- create mode 100755 verify
- [detached HEAD ede6f69] exercise_001_complete_initial_state
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 13:10:24 2015 +0200
- 6 files changed, 82 insertions(+), 40 deletions(-)
- rewrite src/test/resources/README.md (91%)
- [detached HEAD 2a3e6ad] exercise_002_remoting
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 14:18:05 2015 +0200
- 10 files changed, 106 insertions(+), 95 deletions(-)
- rewrite src/test/resources/README.md (92%)
- [detached HEAD 5160dd8] exercise_003_cluster_events
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 14:32:16 2015 +0200
- 5 files changed, 144 insertions(+), 72 deletions(-)
- rewrite src/test/resources/README.md (73%)
- [detached HEAD 541e85b] exercise_004_cluster_aware_routers
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 15:23:39 2015 +0200
- 5 files changed, 82 insertions(+), 56 deletions(-)
- rewrite src/test/resources/README.md (94%)
- [detached HEAD d364d0d] exercise_005_cluster_singleton
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 15:41:04 2015 +0200
- 4 files changed, 138 insertions(+), 186 deletions(-)
- rewrite src/main/java/com/typesafe/training/akkacollect/GameEngine.java (69%)
- rewrite src/test/resources/README.md (65%)
- [detached HEAD 3cbe069] exercise_006_cluster_sharding
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 16:10:36 2015 +0200
- 9 files changed, 404 insertions(+), 52 deletions(-)
- create mode 100644 src/main/java/com/typesafe/training/akkacollect/PlayerSharding.java
- rewrite src/test/resources/README.md (66%)
- [detached HEAD e4d0d22] exercise_007_persistent_actors
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 16:39:47 2015 +0200
- 3 files changed, 146 insertions(+), 220 deletions(-)
- rewrite src/test/resources/README.md (88%)
- [detached HEAD 051dc07] exercise_008_data_replication
- Author: Nilanjan Raychaudhuri <nraychaudhuri@gmail.com>
- Date: Wed Jun 24 16:49:46 2015 +0200
- 3 files changed, 80 insertions(+), 56 deletions(-)
- rewrite src/test/resources/README.md (68%)
- Successfully rebased and updated refs/heads/master.
- ```
- The result now looks as follows for the AAJ course:
- ```
- [ericloots@Eric-Loots-MBP] $ git lol
- 051dc07 exercise_008_data_replication
- e4d0d22 exercise_007_persistent_actors
- 3cbe069 exercise_006_cluster_sharding
- d364d0d exercise_005_cluster_singleton
- 541e85b exercise_004_cluster_aware_routers
- 5160dd8 exercise_003_cluster_events
- 2a3e6ad exercise_002_remoting
- ede6f69 exercise_001_complete_initial_state
- 6c60eea exercise_000_initial_state
- ```
- It would now be cool if this repo would meet the conditions for the `delinearize` command for converting a delinearized repo to the _normal_ course master repo layout. Unfortunately, this isn't the case, as `delinearize` assumes that the project is (sbt) multi-project. Let's try to convert the repo to something that looks like what's needed...
- Let's start by adding a common folder to each commit (holding at least one file, `.gitignore` in this case. We'll utilize git filter-branch to do the actual work.
- First we create a shell script that will create a `common` directory with an empty `.gitignore` file in it:
- ```
- [ericloots@Eric-Loots-MBP] $ ls -l /tmp/mkCommon
- -rwxr-xr-x 1 ericloots wheel 49 Jan 24 11:01 /tmp/mkCommon
- [ericloots@Eric-Loots-MBP] $ cat /tmp/mkCommon
- #!/bin/ksh
- mkdir common
- touch common/.gitignore
- ```
- Now we can run `filter-branch` and quickly do a small verification:
- ```
- [ericloots@Eric-Loots-MBP] $ git filter-branch --tree-filter /tmp/mkCommon -f
- Rewrite 051dc07a5302354f5a19dd59b5357d44fcf8e998 (9/9) (1 seconds passed, remaining 0 predicted)
- Ref 'refs/heads/master' was rewritten
- [ericloots@Eric-Loots-MBP] $ ls
- LICENSE build.sbt man.sbt shell-prompt.sbt tags
- README.md common project src verify
- /lbt/AAJ/advanced-akka-java
- [ericloots@Eric-Loots-MBP] $ git lol
- 6854272 exercise_008_data_replication
- e193f6f exercise_007_persistent_actors
- 7bac4ec exercise_006_cluster_sharding
- fdeff34 exercise_005_cluster_singleton
- a53ae20 exercise_004_cluster_aware_routers
- 446cf41 exercise_003_cluster_events
- f31d616 exercise_002_remoting
- a1aa3af exercise_001_complete_initial_state
- 0b900bc exercise_000_initial_state
- [ericloots@Eric-Loots-MBP] $ git co 0b900bc
- Note: checking out '0b900bc'.
- You are in 'detached HEAD' state. You can look around, make experimental
- changes and commit them, and you can discard any commits you make in this
- state without impacting any branches by performing another checkout.
- If you want to create a new branch to retain commits you create, you may
- do so (now or later) by using -b with the checkout command again. Example:
- git checkout -b <new-branch-name>
- HEAD is now at 0b900bc... exercise_000_initial_state
- [ericloots@Eric-Loots-MBP] $ ll -a common
- total 0
- drwxr-xr-x 3 ericloots staff 102 Jan 24 11:01 .
- drwxr-xr-x 14 ericloots staff 476 Jan 24 11:01 ..
- -rw-r--r-- 1 ericloots staff 0 Jan 24 11:01 .gitignore
- [ericloots@Eric-Loots-MBP] $ git co master
- Previous HEAD position was 0b900bc... exercise_000_initial_state
- Switched to branch 'master'
- Your branch and 'origin/master' have diverged,
- and have 9 and 10 different commits each, respectively.
- (use "git pull" to merge the remote branch into yours)
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement