Skip to content

Commit c3e0faa

Browse files
committed
🔥 --readme
`--readme` is not a common flag for programs. Documentation will be put in somewhere like share/doc/gister/README.md instead.
1 parent c96447d commit c3e0faa

File tree

1 file changed

+0
-183
lines changed

1 file changed

+0
-183
lines changed

bin/gister

-183
Original file line numberDiff line numberDiff line change
@@ -53,188 +53,6 @@ Within the root directory of a git repository,
5353
END
5454
}
5555

56-
readme() {
57-
cat<<'END'
58-
gister
59-
======
60-
61-
`gister` is a command line tool for managing GitHub gists.
62-
63-
Based on [gist.rb][gist] by [@defunkt][defunkt], this tool helps you to manage a local copy of your gists.
64-
65-
After publishing files to gist.github.com, this tool will:
66-
67-
- automatically clone the gist repository to local
68-
- index the content of your gist for code search
69-
- fetch meta info (e.g. description, url) of the gist from GitHub and add them to `gists.list`.
70-
71-
[gist]: https://github.com/defunkt/gist
72-
[defunkt]: https://github.com/defunkt
73-
74-
You can also use `gister` to sync your gists (created and starred)
75-
between gist.github.com and your machine.
76-
77-
Dependencies
78-
------------
79-
80-
- curl
81-
- git
82-
- [gist.rb][gist]
83-
- [jq](http://stedolan.github.io/jq/)
84-
85-
For Linux, BSD, etc, you also need `xclip` or `xsel`.
86-
For Cygwin, you need putclip/getclip provided by cygutils-extra.
87-
(Mas OS X users should be fine with the preinstalled pbcopy/pbpaste.)
88-
89-
Mac OS X users also need GNU versions of `sed` and `date`, a.k.a `gsed` and
90-
`gdate`.
91-
92-
Note: `xsel` users should use `gist.rb` v4.1.2+, since there is [a bug bitting xsel users in previous versions][151].
93-
94-
[151]: https://github.com/defunkt/gist/pull/151
95-
96-
### Optional Dependencies
97-
98-
- [csearch](https://github.com/google/codesearch)
99-
100-
To search gists on your local machine.
101-
If not available, gister fallbacks to `grep`.
102-
103-
- [legit](https://github.com/kennethreitz/legit)
104-
105-
If available, invokes `legit sync` to sync gist repository.
106-
Legit will stash, fetch, rebase/merge, push, and unstash if necessary.
107-
108-
The `develop` branch of legit allows configuration for merge policy:
109-
110-
* The default smart merge (rebase when suitable)
111-
* Always merge, never rebase (since [21bb7ed])
112-
* Always rebase, never merge (since [252b1eb])
113-
* Fast forward merge only (since [4782928])
114-
115-
If legit is not available,
116-
gister will report dirty gist repositories (`DIRTY $gist_id`)
117-
when the environment variable `GISTER_AUTO_COMMIT` does not exist,
118-
and will commit files automatically when `GISTER_AUTO_COMMIT` exists.
119-
120-
[21bb7ed]: https://github.com/kennethreitz/legit/commit/21bb7edd081f9e47abec9b970b32f2814104d298
121-
[252b1eb]: https://github.com/kennethreitz/legit/commit/252b1eb2cd1c0a8f223fa8022ed37752bd5d6cec
122-
[4782928]: https://github.com/kennethreitz/legit/commit/478292899831c1da478490970bc5d4f66d117510
123-
124-
Install
125-
-------
126-
127-
Note that the following instructions only install gister itself.
128-
You need to install its dependencies mentioned before yourself.
129-
130-
git clone https://github.com/weakish/gister.git
131-
cd gister
132-
make install
133-
134-
- Edit `config.mk` if you do not want to install it to `/usr/local`.
135-
- Compatible with both GNU and BSD make.
136-
137-
To uninstall:
138-
139-
```sh
140-
; cd gister
141-
; make uninstall
142-
```
143-
144-
You can also install/uninstall gister via [basher].
145-
146-
[basher]: https://github.com/basherpm/basher
147-
148-
Usage
149-
-----
150-
151-
### init
152-
153-
For the first time, you need to run `gister init` to associate your GitHub account and configure the directory to store local copies of your gists.
154-
155-
After that, you may run `gister sync` to fetch all your gists (created and starred) to local.
156-
157-
Warn: `sync` can only fetch up to 10 million gists for you. If you have more than 10 million gists, you need to modify the source of `gister` to lift the limit.
158-
159-
### Configuration
160-
161-
`GISTER_USE_HTTPS`: If you need to use https for some reason, set the env var `GISTER_USE_HTTPS`, but please note this isn't necessarily more secure than ssh, it's just a different option in case your network blocks all traffic other than http/s.
162-
163-
`GISTER_AUTO_COMMIT`: If you'd like the `sync` command to automatically commit any local changes you've made before pulling and pushing to gist.github.com, set the `GISTER_AUTO_COMMIT` env var to anything.
164-
165-
### publish
166-
167-
Whenever you want to publish a gist, just use
168-
169-
gister description file.txt ...
170-
171-
This will create the gist with the provided description, clone the gist repo, and put the gistid to clipborad.
172-
173-
Note: you must provide gist description, otherwise `gister` will fail.
174-
175-
Hint: `gister` will pass all arguments to gist as `gist -c -o -d description ...`, so you can use other options that gist understands, e.g. `gister description -P` will work.
176-
177-
If you've edited your gists at `gist.github.com` or local machine, without pull/push changesets, you can sync all your gists via `gister sync`.
178-
179-
If you've deleted your gists at `gist.github.com`, after `gister sync`, the directories of deleted gists at your local machine will be marked with a prefix `_`.
180-
181-
### search
182-
183-
Search all of your gists:
184-
185-
gister search regexp
186-
187-
If `codesearch` is installed, `regexp` is RE2 (nearly PCRE).
188-
Otherwise it is ERE, a.k.a `grep -E`.
189-
190-
### export
191-
192-
Export a gist (available at local) to a git repository,
193-
with its full history:
194-
195-
```sh
196-
; cd git-repo-root
197-
; gister export gist_id sub_directory_name branch_name
198-
```
199-
200-
The content of the gist will be exported to `sub_directory_name`,
201-
and the merging message will use `branch_name`.
202-
203-
### migrate
204-
205-
From version 1.0.0, `gister` uses a different storage structure.
206-
If you have used `gister <1.0.0`, then you need to run this command to migrate:
207-
208-
gister migrate
209-
210-
211-
Storage
212-
-------
213-
214-
/path/to/your/gists
215-
|-- gists.list # a list of all your gists (including meta info)
216-
|-- repo # git repositories of your gists
217-
|-- tree # working directory of your gist repositories
218-
|-- 123456 # an example of gist
219-
|-- _123567890 # an example of gist which you have deleted on gist.github.com
220-
|-- ...
221-
`-- .csearchindex # code search index (optional)
222-
223-
224-
Contributing
225-
------------
226-
227-
Send pull requests or issues at:
228-
229-
https://github.com/weakish/gister
230-
231-
### Tips
232-
233-
Setting environment variable `GISTER_DEBUG` to `true` (or any non-empty string) will enable debug mode (`set -x`).
234-
235-
END
236-
}
237-
23856
main() {
23957
gisthome=${GIST_HOME:=$(git config --global --path --get gist.home)}
24058
if test -f $HOME/.gist; then
@@ -253,7 +71,6 @@ case $1 in
25371
check) check;;
25472
fetchall) fetchall;;
25573
help|-h|--help) help;;
256-
readme|--readme) readme;;
25774
export) export_to $2 $3 $4;;
25875
init) init;;
25976
migrate) migrate;;

0 commit comments

Comments
 (0)