Skip to content

Instantly share code, notes, and snippets.

@cben
Last active August 9, 2019 07:32
Show Gist options
  • Select an option

  • Save cben/76c5093f7af0419ba5bf2c5064d74bb8 to your computer and use it in GitHub Desktop.

Select an option

Save cben/76c5093f7af0419ba5bf2c5064d74bb8 to your computer and use it in GitHub Desktop.

Revisions

  1. cben revised this gist Aug 9, 2019. 2 changed files with 24 additions and 8 deletions.
    14 changes: 11 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,17 @@
    ```sh
    $ cd dir/
    $ ls -l
    $ 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 foo
    $ rm -rf $(find -type f -name '*~')
    ```

    Let's try fish:

    ```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
    18 changes: 13 additions & 5 deletions README.rst
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,18 @@
    .. code-block:: sh
    $ cd dir/
    $ ls -l
    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 foo
    $ 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:

    .. code-block:: 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

  2. cben revised this gist Aug 9, 2019. 2 changed files with 131 additions and 116 deletions.
    239 changes: 123 additions & 116 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,127 +1,134 @@
    Stolen from https://github.com/mackyle/topgit/blob/master/README
    ```sh
    $ cd dir/
    $ ls -l
    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 foo
    ```

    ```bash
    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
    ```sh
    ## 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 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: [email protected]
    To: [email protected]
    Cc: [email protected]
    Subject: [PATCH] Fix broken revlist --author when --fixed-string
    ## 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: [email protected]
    To: [email protected]
    Cc: [email protected]
    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
    ## 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 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...
    ## 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
    ## 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
    ## 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
    ## Update from a non-default TopGit remote
    $ git fetch foo
    $ tg -r foo summary
    $ tg -r foo update
    ```
    8 changes: 8 additions & 0 deletions README.rst
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    .. code-block:: sh
    $ cd dir/
    $ ls -l
    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 foo
    Stolen from https://github.com/cben/topgit/blob/248246e28fda3934e21b1d7185519088e71e4657/README

    .. code-block:: sh
  3. cben revised this gist Aug 9, 2019. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    Stolen from https://github.com/mackyle/topgit/blob/master/README

    ```sh
    ## Create and evolve a topic branch
    ```bash

    ## 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...
  4. cben created this gist Aug 9, 2019.
    126 changes: 126 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,126 @@
    Stolen from https://github.com/mackyle/topgit/blob/master/README

    ```sh
    ## 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: [email protected]
    To: [email protected]
    Cc: [email protected]
    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
    ```
    126 changes: 126 additions & 0 deletions README.rst
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,126 @@
    Stolen from https://github.com/cben/topgit/blob/248246e28fda3934e21b1d7185519088e71e4657/README

    .. code-block:: sh
    ## 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: [email protected]
    To: [email protected]
    Cc: [email protected]
    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