Skip to content

Instantly share code, notes, and snippets.

@cben
Last active August 9, 2019 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cben/76c5093f7af0419ba5bf2c5064d74bb8 to your computer and use it in GitHub Desktop.
Save cben/76c5093f7af0419ba5bf2c5064d74bb8 to your computer and use it in GitHub Desktop.
testing github shell highlighting md vs rst
$ cd dir/ && ls -l "$files{@}"
drwxr-xr-x.  6 bpaskinc bpaskinc       4,096 Aug 30  2017  prometheus_api_client_ruby/
drwxr-xr-x.  2 bpaskinc bpaskinc       4,096 Feb  3  2016  Public/
$ rm -rf $(find -type f -name '*~')

Let's try fish:

$ cd dir/; and ls -l $files
drwxr-xr-x.  6 bpaskinc bpaskinc       4,096 Aug 30  2017  prometheus_api_client_ruby/
drwxr-xr-x.  2 bpaskinc bpaskinc       4,096 Feb  3  2016  Public/
$ rm -rf (find -type f -name '*~')

Stolen from https://github.com/mackyle/topgit/blob/master/README

## Create and evolve a topic branch
$ tg create t/gitweb/pathinfo-action
tg: Automatically marking dependency on master
tg: Creating t/gitweb/pathinfo-action base from master...
$ ..hack..
$ git commit
$ ..fix a mistake..
$ git commit

## Create another topic branch on top of the former one
$ tg create t/gitweb/nifty-links
tg: Automatically marking dependency on t/gitweb/pathinfo-action
tg: Creating t/gitweb/nifty-links base from t/gitweb/pathinfo-action...
$ ..hack..
$ git commit

## Create another topic branch on top of master and submit
## the resulting patch upstream
$ tg create t/revlist/author-fixed master
tg: Creating t/revlist/author-fixed base from master...
$ ..hack..
$ git commit
$ tg patch -m
tg: Sent t/revlist/author-fixed
From: pasky@suse.cz
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH] Fix broken revlist --author when --fixed-string

## Create another topic branch depending on two others non-trivially
$ tg create t/whatever t/revlist/author-fixed t/gitweb/nifty-links
tg: Creating t/whatever base from t/revlist/author-fixed...
tg: Merging t/whatever base with t/gitweb/nifty-links...
Merge failed!
tg: Please commit merge resolution and call: tg update --continue
tg: It is also safe to abort this operation using `git reset --hard`
tg: but please remember you are on the base branch now;
tg: you will want to switch to a different branch.
$ ..resolve..
$ git commit
$ tg update --continue
$ ..hack..
$ git commit

## Update a single topic branch and propagate the changes to
## a different one
$ git checkout t/gitweb/nifty-links
$ ..hack..
$ git commit
$ git checkout t/whatever
$ tg info
Topic Branch: t/whatever (1 commit)
Subject: [PATCH] Whatever patch
Base: 3f47ebc1
Depends: t/revlist/author-fixed t/gitweb/nifty-links
Needs update from:
t/gitweb/nifty-links (1 commit)
$ tg update
tg: Updating base with t/gitweb/nifty-links changes...
Merge failed!
tg: Please commit merge resolution and call `tg update --continue`
tg: (use `tg status` to see more options)
$ ..resolve..
$ git commit
$ tg update --continue
tg: Updating t/whatever against new base...
Merge failed!
tg: Please commit merge resolution and call `tg update --continue`
tg: (use `tg status` to see more options)
$ ..resolve..
$ git commit
$ tg update --continue

## Update a single topic branch and propagate the changes
## further through the dependency chain
$ git checkout t/gitweb/pathinfo-action
$ ..hack..
$ git commit
$ git checkout t/whatever
$ tg info
Topic Branch: t/whatever (1/2 commits)
Subject: [PATCH] Whatever patch
Base: 0ab2c9b3
Depends: t/revlist/author-fixed t/gitweb/nifty-links
Needs update from:
t/gitweb/pathinfo-action (<= t/gitweb/nifty-links) (1 commit)
$ tg update
tg: Recursing to t/gitweb/nifty-links...
[t/gitweb/nifty-links] tg: Updating base with t/gitweb/pathinfo-action changes...
Merge failed!
[t/gitweb/nifty-links] tg: Please commit merge resolution and call `tg update --continue`
[t/gitweb/nifty-links] tg: (use `tg status` to see more options)
$ ..resolve..
$ git commit
$ tg update --continue
[t/gitweb/nifty-links] tg: Updating t/gitweb/nifty-links against new base...
Merge failed!
[t/gitweb/nifty-links] tg: Please commit merge resolution and call `tg update --continue`
[t/gitweb/nifty-links] tg: (use `tg status` to see more options)
$ ..resolve..
$ git commit
$ tg update --continue
tg: Updating base with t/gitweb/nifty-links changes...
tg: Updating t/whatever against new base...

## Clone a TopGit-controlled repository
$ git clone URL repo
$ cd repo
$ tg remote --populate origin
...
$ git fetch
$ tg update

## Add a TopGit remote to a repository and push to it
$ git remote add foo URL
$ tg remote foo
$ tg push -r foo

## Update from a non-default TopGit remote
$ git fetch foo
$ tg -r foo summary
$ tg -r foo update
$ cd dir/ && ls -l "$files{@}"
drwxr-xr-x.  6 bpaskinc bpaskinc       4,096 Aug 30  2017  prometheus_api_client_ruby/
drwxr-xr-x.  2 bpaskinc bpaskinc       4,096 Feb  3  2016  Public/
$ rm -rf $(find -type f -name '*~')

Let's try fish:

$ cd dir/; and ls -l $files
drwxr-xr-x.  6 bpaskinc bpaskinc       4,096 Aug 30  2017  prometheus_api_client_ruby/
drwxr-xr-x.  2 bpaskinc bpaskinc       4,096 Feb  3  2016  Public/
$ rm -rf (find -type f -name '*~')

Stolen from https://github.com/cben/topgit/blob/248246e28fda3934e21b1d7185519088e71e4657/README

## Create and evolve a topic branch
$ tg create t/gitweb/pathinfo-action
tg: Automatically marking dependency on master
tg: Creating t/gitweb/pathinfo-action base from master...
$ ..hack..
$ git commit
$ ..fix a mistake..
$ git commit

## Create another topic branch on top of the former one
$ tg create t/gitweb/nifty-links
tg: Automatically marking dependency on t/gitweb/pathinfo-action
tg: Creating t/gitweb/nifty-links base from t/gitweb/pathinfo-action...
$ ..hack..
$ git commit

## Create another topic branch on top of master and submit
## the resulting patch upstream
$ tg create t/revlist/author-fixed master
tg: Creating t/revlist/author-fixed base from master...
$ ..hack..
$ git commit
$ tg patch -m
tg: Sent t/revlist/author-fixed
From: pasky@suse.cz
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH] Fix broken revlist --author when --fixed-string

## Create another topic branch depending on two others non-trivially
$ tg create t/whatever t/revlist/author-fixed t/gitweb/nifty-links
tg: Creating t/whatever base from t/revlist/author-fixed...
tg: Merging t/whatever base with t/gitweb/nifty-links...
Merge failed!
tg: Please commit merge resolution and call: tg update --continue
tg: It is also safe to abort this operation using `git reset --hard`
tg: but please remember you are on the base branch now;
tg: you will want to switch to a different branch.
$ ..resolve..
$ git commit
$ tg update --continue
$ ..hack..
$ git commit

## Update a single topic branch and propagate the changes to
## a different one
$ git checkout t/gitweb/nifty-links
$ ..hack..
$ git commit
$ git checkout t/whatever
$ tg info
Topic Branch: t/whatever (1 commit)
Subject: [PATCH] Whatever patch
Base: 3f47ebc1
Depends: t/revlist/author-fixed t/gitweb/nifty-links
Needs update from:
    t/gitweb/nifty-links (1 commit)
$ tg update
tg: Updating base with t/gitweb/nifty-links changes...
Merge failed!
tg: Please commit merge resolution and call `tg update --continue`
tg: (use `tg status` to see more options)
$ ..resolve..
$ git commit
$ tg update --continue
tg: Updating t/whatever against new base...
Merge failed!
tg: Please commit merge resolution and call `tg update --continue`
tg: (use `tg status` to see more options)
$ ..resolve..
$ git commit
$ tg update --continue

## Update a single topic branch and propagate the changes
## further through the dependency chain
$ git checkout t/gitweb/pathinfo-action
$ ..hack..
$ git commit
$ git checkout t/whatever
$ tg info
Topic Branch: t/whatever (1/2 commits)
Subject: [PATCH] Whatever patch
Base: 0ab2c9b3
Depends: t/revlist/author-fixed t/gitweb/nifty-links
Needs update from:
    t/gitweb/pathinfo-action (<= t/gitweb/nifty-links) (1 commit)
$ tg update
tg: Recursing to t/gitweb/nifty-links...
[t/gitweb/nifty-links] tg: Updating base with t/gitweb/pathinfo-action changes...
Merge failed!
[t/gitweb/nifty-links] tg: Please commit merge resolution and call `tg update --continue`
[t/gitweb/nifty-links] tg: (use `tg status` to see more options)
$ ..resolve..
$ git commit
$ tg update --continue
[t/gitweb/nifty-links] tg: Updating t/gitweb/nifty-links against new base...
Merge failed!
[t/gitweb/nifty-links] tg: Please commit merge resolution and call `tg update --continue`
[t/gitweb/nifty-links] tg: (use `tg status` to see more options)
$ ..resolve..
$ git commit
$ tg update --continue
tg: Updating base with t/gitweb/nifty-links changes...
tg: Updating t/whatever against new base...

## Clone a TopGit-controlled repository
$ git clone URL repo
$ cd repo
$ tg remote --populate origin
...
$ git fetch
$ tg update

## Add a TopGit remote to a repository and push to it
$ git remote add foo URL
$ tg remote foo
$ tg push -r foo

## Update from a non-default TopGit remote
$ git fetch foo
$ tg -r foo summary
$ tg -r foo update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment