jmalloc / grit Goto Github PK
View Code? Open in Web Editor NEWKeep track of your local Git clones.
License: MIT License
Keep track of your local Git clones.
License: MIT License
Unlike grit index ls
this would only list each clone once, rather than for each indexed slug.
Not technically blocked, but makes sense to finish #3 first.
grit mv
- moves the current clone to the standard clone.root
locationgrit mv --golang
- equivalent for $GOPATH/src
This seems to be an Ubuntu convention that is being adopted more widely. For example Yarn and Hub both store their configuration here.
Currently the slug is indexed exactly two levels deep. That is the slug foo/bar
is indexed as:
foo/bar
bar
This 'tail matching' should extend to an arbitrary number of levels, such that foo/bar/baz
is indexed as:
foo/bar/baz
bar/baz
baz
This error happens when I try to use shell integration. It's due to "complete" being a Bash function, and I'm using Zsh. There are ways around it on my end, but they will apparently slow down my Zsh.
Sometimes I get this:
$ grit clone slouchhat/ui
probing 2 source(s) for slouchhat/ui
ghe: trying [email protected]:slouchhat/ui.git
github: trying [email protected]:slouchhat/ui.git
ghe: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
github: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
could not find 'slouchhat/ui' at any of the configured sources
Grit has previously been working fine for me.
rm [<slug>]
- prompts, just like clone, defaults to repo in current dir.
Then you can just use
source <(grit init-shell)
In your .bash_profile
Some commands now take paths as arguments but they do not match the entries in the index even if they point to the same place.
Blocked by #5
If multiple sources have a repo with a matching slug, prompt for a specific source to use (like index select
).
At the moment Grit discovers whether a repo exists by trying to clone it, so we'll need a lighter weight way to do that (probably concurrently). git remote-ls
is probably the way to do it from the command, so maybe aim for the equivalent in go-git
.
Blocked by src-d/go-git#358
The Git library used by Grit (go-git v4) is not yet considered production ready anyway, so this is not surprising. v3 might be a better fit for now.
TL;DR Information about clones that are made with grit clone
should survive index rebuilds.
As well as repo slugs.
Allow disabling auto-checks via config.
I don't need more network requests every time I open a new terminal.
$ grit clone foo/bar
remote repository is empty
could not find 'foo/bar' at any of the configured sources
Equivalent to git log --branches --not --remotes
.
I'm not sure how well this would work, but for shell integration (changing directories, etc) it might be more flexible if Grit directly outputs the shell commands to execute.
Works correctly without --source
.
source ls
source add <name> <url template>
source rm <name>
index path ls
index path add <path>
index path rm <path>
grit alias <slug> [<path>]
Add an alias for the clone at <path>
. This info can be added to the git config so that it's not solely in the index, hence it can be rediscovered with an index scan
.
For example, assuming the current URL is git@host:a/b/c.git
, the command would change the URL as follows:
grit rename x
-> git@host:a/b/x.git
grit rename x/y
-> git@host:a/x/y.git
grit rename x/y/z
-> git@host:x/y/z.git
And then move the repo into the appropriate location and update the index.
{{.Slug}}
in source URLsI saw this issue on @koden-km's machine when we were playing around with grit clones.
Kev, if you still have it, could you try a grit rm
on that grit
clone we made in your $GOPATH and see if it still says there are ~2000 uncommitted changes?
We currently rely on GitHub's pre-release flag on the releases page.
probing N source(s) for jmalloc/grittest
xxxx: trying [email protected]:jmalloc/grittest.git
github: trying [email protected]:jmalloc/grittest.git
github: found [email protected]:jmalloc/grittest.git
mkdir /Users/james/grit/github.com/jmalloc/grittest/.git/refs: file exists
Does not occur when repo has a commit
Grit somewhat naively assumes that $GOPATH
is always a single directory.
Gists can be cloned using the Gist hash, either from gist.github.com, or github.com - but the "slug" is not very memorable / useful.
Fresh install of grit 0.2.1 and running grit config
with no config file gave me this:
~: grit config
panic: assignment to entry in nil map
goroutine 1 [running]:
github.com/jmalloc/grit/src/grit.(*Config).normalizeClone(0xc420013c80, 0xc4200f1b40, 0x12, 0xc4200f1b53, 0xb)
/home/travis/gopath/src/github.com/jmalloc/grit/src/grit/config.go:70 +0x1e4
github.com/jmalloc/grit/src/grit.(*Config).normalize(0xc420013c80, 0xc4200f1b40, 0x12, 0x12, 0x0)
/home/travis/gopath/src/github.com/jmalloc/grit/src/grit/config.go:56 +0x43
github.com/jmalloc/grit/src/grit.LoadConfig(0xc4200f1b40, 0x1e, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, ...)
/home/travis/gopath/src/github.com/jmalloc/grit/src/grit/config.go:50 +0x443
main.loadConfig(0xc4200c28c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x151d38f)
/home/travis/gopath/src/github.com/jmalloc/grit/src/cmd/grit/main.go:120 +0x9b
main.withConfig.func1(0xc4200c28c0, 0x0, 0xc4200c28c0)
/home/travis/gopath/src/github.com/jmalloc/grit/src/cmd/grit/main.go:125 +0x49
github.com/jmalloc/grit/vendor/github.com/urfave/cli.HandleAction(0x148d600, 0xc420011f80, 0xc4200c28c0, 0xc420068700, 0x0)
/home/travis/gopath/src/github.com/jmalloc/grit/vendor/github.com/urfave/cli/app.go:483 +0x10f
github.com/jmalloc/grit/vendor/github.com/urfave/cli.Command.Run(0x151e06a, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x152f842, 0x24, 0x0, ...)
/home/travis/gopath/src/github.com/jmalloc/grit/vendor/github.com/urfave/cli/command.go:193 +0xb72
github.com/jmalloc/grit/vendor/github.com/urfave/cli.(*App).Run(0xc4200fe340, 0xc42000a1a0, 0x2, 0x2, 0x0, 0x0)
/home/travis/gopath/src/github.com/jmalloc/grit/vendor/github.com/urfave/cli/app.go:250 +0x7d0
main.main()
/home/travis/gopath/src/github.com/jmalloc/grit/src/cmd/grit/main.go:114 +0x8f1
When i tried to git pull
on a freshly grit clone
'ed repo i get the git message about no tracking setup.
$ grit clone --golang jmalloc/grit
~/go/src/github.com/jmalloc/grit
$ cd ~/go/src/github.com/jmalloc/grit
jmalloc/grit master $ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
jmalloc/grit master $ git remote -v
origin [email protected]:jmalloc/grit.git (fetch)
origin [email protected]:jmalloc/grit.git (push)
grit index scan .
doesn't find the repo in the current directory.
Accepts the same parameters as 'clone' but inits a new empty repo and sets up the remote.
Perhaps later it could create the repo through GH/BitBucket APIs, but the hub
command can do this anyway (for GH obviously).
e.g: grit clone jmalloc/grit --from=github
https://github.com/Homebrew/brew/blob/master/docs/How-to-Create-and-Maintain-a-Tap.md
This would require a build without the self-update
command.
For example:
grit clone jmalloc/grit --to=/tmp/dir
NAME:
grit browse - Open a browser window to the GitHub project associated with <slug>.
USAGE:
grit browse <slug>
For reference, i had a manual debug build from master branch newer than 0.3.1 (it has the selfupdate
alias removed).
$ grit self-update --force
searching for the latest release
downloading version 0.3.1 (100%, 3.4 MB / 3.4 MB)
reinstalled version 0.3.1
It left behind the grit.0.3.1.backup
file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.