Skip to content

Instantly share code, notes, and snippets.

@hraban hraban/a.sh-session
Last active Aug 16, 2016

Embed
What would you like to do?
code snippets for Ravelin blog post
/tmp $ git clone -q github.com/unravelin/tomono
/tmp $ cat sub-repositories.txt
https://github.com/outr/scalarelational.git scalarelational
https://github.com/realph/gulp-zero.git zero
https://github.com/reaxis/mu µ
/tmp $ cat sub-repositories.txt | ./tomono/tomono.sh
… crunch crunch crunch
/tmp $ cd core
/tmp/core $ git branch
2.0.0
angular-branch
implicit_sessions
* master
remove_powerscala
/tmp/core $ ls -F1
scalarelational/
zero/
µ/
/tmp/core $ alias gitlog='git log --graph --format="format:%h %s%d (%aN, %ar)" --all --branches=\* --remotes=\*'
/tmp/core $ gitlog | head
* 4a21d29 Merging µ to master (HEAD -> master) (Hraban Luyat, 0 seconds ago)
|\
| * 0f0a833 .attr() now uses setAttribute() and getAttribute to make it work with data- attributes (µ/master) (Koen Mostert, 1 year, 3 months ago)
| * 9fe9636 added .remove() (Koen Mostert, 1 year, 3 months ago)
| * ce7a6e9 Merge branch 'master' of https://github.com/reaxis/mu (Koen Mostert, 1 year, 3 months ago)
| |\
| | * 56df7d9 initiating µ twice resulted in an infinite loop of adding event handlers (Koen Mostert, 1 year, 4 months ago)
| * | ab10873 more tests (Koen Mostert, 1 year, 3 months ago)
| |/
| * b9639c9 mu is now an alias for µ (Koen Mostert, 1 year, 4 months ago)
/tmp/core $ cd ..
/tmp $ mkdir fake-repo
/tmp $ cd fake-repo
/tmp/fake-repo $ git init
Initialized empty Git repository in /private/tmp/fake-repo/.git/
/tmp/fake-repo $ echo hello > world
/tmp/fake-repo $ git add -A .
/tmp/fake-repo $ git commit -m 'initial commit in fake-repo (add file world)'
[master (root-commit) e74125e] initial commit in fake-repo (add file world)
1 file changed, 1 insertion(+)
create mode 100644 world
/tmp/fake-repo $ cd ..
/tmp $ ./tomono/tomono.sh --continue <<EOF
> /tmp/fake-repo foo
> EOF
/tmp/core /tmp
Merging in /tmp/fake-repo..
warning: no common commits
4a21d29473e8ed735d60e3d4e785c3860340a335
Automatic merge went well; stopped before committing as requested
/tmp $ cd core
/tmp/core $ ls -F1
foo/
scalarelational/
zero/
µ/
/tmp/core $ ls -F1 foo/*
foo/world
/tmp/core $ cd ../fake-repo
/tmp/fake-repo $ echo bonjour > monde
/tmp/fake-repo $ git add -A .
/tmp/fake-repo $ git commit -m 'fake-repo commit #2 (add file monde)'
[master bddded4] fake-repo commit #2 (add file monde)
1 file changed, 1 insertion(+)
create mode 100644 monde
/tmp/core $ git fetch --all
Fetching scalarelational
Fetching zero
Fetching µ
Fetching foo
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /tmp/fake-repo
e74125e..bddded4 master -> foo/master
/tmp/core $ gitlog | head
* 18fe403 Merging foo to master (HEAD -> master) (Hraban Luyat, 2 seconds ago)
|\
* \ 4a21d29 Merging µ to master (Hraban Luyat, 2 seconds ago)
|\ \
| * | 0f0a833 .attr() now uses setAttribute() and getAttribute to make it work with data- attributes (µ/master) (Koen Mostert, 1 year, 3 months ago)
| * | 9fe9636 added .remove() (Koen Mostert, 1 year, 3 months ago)
| * | ce7a6e9 Merge branch 'master' of https://github.com/reaxis/mu (Koen Mostert, 1 year, 3 months ago)
| |\ \
| | * | 56df7d9 initiating µ twice resulted in an infinite loop of adding event handlers (Koen Mostert, 1 year, 4 months ago)
| * | | ab10873 more tests (Koen Mostert, 1 year, 3 months ago)
/tmp/core $ git merge -m 'merge foo/master into master' foo/master
Merge made by the 'recursive' strategy.
monde | 1 +
1 file changed, 1 insertion(+)
create mode 100644 monde
/tmp/core $ ls -F1
foo/
monde
scalarelational/
zero/
µ/
/tmp/core $ gitlog | head
* 37cccbb merge foo/master into master (HEAD -> master) (Hraban Luyat, 0 seconds ago)
|\
| * bddded4 fake-repo commit #2 (add file monde) (foo/master) (Hraban Luyat, 2 seconds ago)
* | 18fe403 Merging foo to master (Hraban Luyat, 2 seconds ago)
|\ \
| |/
| * e74125e initial commit in fake-repo (add file world) (Hraban Luyat, 2 seconds ago)
* 4a21d29 Merging µ to master (Hraban Luyat, 2 seconds ago)
|\
| * 0f0a833 .attr() now uses setAttribute() and getAttribute to make it work with data- attributes (µ/master) (Koen Mostert, 1 year, 3 months ago)
/tmp/core $ git reset --hard HEAD~
HEAD is now at 18fe403 Merging foo to master
/tmp/core $ git merge -m 'merge foo/master into master (with subtree)' -X subtre ^Me=foo foo/master
Merge made by the 'recursive' strategy.
foo/monde | 1 +
1 file changed, 1 insertion(+)
create mode 100644 foo/monde
/tmp/core $ ls -F1
foo/
scalarelational/
zero/
µ/
/tmp/core $ ls -F1 foo/*
foo/monde
foo/world
/tmp/core $ gitlog | head
* 20991c9 merge foo/master into master (with subtree) (HEAD -> master) (Hraban Luyat, 0 seconds ago)
|\
| * bddded4 fake-repo commit #2 (add file monde) (foo/master) (Hraban Luyat, 2 seconds ago)
* | 18fe403 Merging foo to master (Hraban Luyat, 2 seconds ago)
|\ \
| |/
| * e74125e initial commit in fake-repo (add file world) (Hraban Luyat, 2 seconds ago)
* 4a21d29 Merging µ to master (Hraban Luyat, 2 seconds ago)
|\
| * 0f0a833 .attr() now uses setAttribute() and getAttribute to make it work with data- attributes (µ/master) (Koen Mostert, 1 year, 3 months ago)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.