gitless-vcs / gitless Goto Github PK
View Code? Open in Web Editor NEWA simple version control system built on top of Git
Home Page: https://gitless.com
License: MIT License
A simple version control system built on top of Git
Home Page: https://gitless.com
License: MIT License
I installed gitless via pip just a few minutes ago and right away noticed something was up as I couldn't use the gl command at all. As it turns out, 'gl' is a global command alias in PowerShell that can't be overwritten. I'm not sure that this is really a fixable issue, unless the command itself is changed, but I just wanted to make others aware of the issue and post my workaround.
EDIT: I should be clear that in PowerShell 'gl' is an alias of Get-Location.
The simple solution to this is to edit your powershell profile and add an alias for gitless. Something other than 'gl'.
Set-Alias g c:\python27\scripts\gl.exe
I used a simple 'g' as it's nice to only have to type one letter. You can use anything though, and be sure to point the path of the alias to where gitless is actually installed (depends on your system/what version of python you're using).
There's a directory in a repo that my user doesn't have permission to read, and gitless does not like it at all:
> gl status
Traceback (most recent call last):
File "/home/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.gl", line 69, in main
File "/home/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.gl_status", line 45, in main
File "/home/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.core", line 752, in status
OSError: Failed to open directory 'dbdata/': Permission denied
0.6.2
Traceback (most recent call last):
File "/Users/ttvrtkovic/.local/venvs/gitless/lib/python2.7/site-packages/gitless/cli/gl.py", line 73, in main
return SUCCESS if args.func(args) else ERRORS_FOUND
File "/Users/ttvrtkovic/.local/venvs/gitless/lib/python2.7/site-packages/gitless/cli/gl_status.py", line 45, in main
for f in file_lib.status_all(include_tracked_unmodified_fps=False):
File "/Users/ttvrtkovic/.local/venvs/gitless/lib/python2.7/site-packages/gitless/core/file.py", line 227, in status_all
include_tracked_unmodified_fps=include_tracked_unmodified_fps):
File "/Users/ttvrtkovic/.local/venvs/gitless/lib/python2.7/site-packages/gitpylib/status.py", line 86, in of_repo
status = _status_from_output(s, s_fp in au_fps, s_fp)
File "/Users/ttvrtkovic/.local/venvs/gitless/lib/python2.7/site-packages/gitpylib/status.py", line 187, in _status_from_output
raise Exception('Failed to get status of file {0}, s is "{1}"'.format(fp, s))
Exception: Failed to get status of file ngs_worker/workers/social.py, s is "D "
social.py has been marked as deleted.
When I wanted to see if there were updates to my 'gl' commands I googled for "gl". Nope.
I checked the output from 'gl --help' and 'gl --version'. Nope.
I tried 'gitless.com'. Nope.
Would be asking to much for you to put a URL in the output to help?
P.S.
I eventually found it by googling for 'gl commit'. Also got a page on how to land a husband...
I use python 3.4
↪ gl history
# Oops...something went wrong (recall that Gitless is in beta). If you want to help, report the bug at http://gitless.com/community.html and include the following information:
0.6.2
Traceback (most recent call last):
File "/home/tim/.virtualenvs/tempenv-7cc217326033a/lib/python3.4/site-packages/gitless/cli/gl.py", line 73, in main
return SUCCESS if args.func(args) else ERRORS_FOUND
File "/home/tim/.virtualenvs/tempenv-7cc217326033a/lib/python3.4/site-packages/gitless/cli/gl_history.py", line 30, in main
for ci in repo_lib.history(include_diffs=args.verbose):
File "/home/tim/.virtualenvs/tempenv-7cc217326033a/lib/python3.4/site-packages/gitless/core/repo.py", line 53, in history
return git_log.log(include_diffs=include_diffs)
File "/home/tim/.virtualenvs/tempenv-7cc217326033a/lib/python3.4/site-packages/gitpylib/log.py", line 26, in log
log_fmt, '-p' if include_diffs else ''))
File "/home/tim/.virtualenvs/tempenv-7cc217326033a/lib/python3.4/site-packages/gitpylib/common.py", line 37, in safe_git_call
ok, out, err = git_call(cmd)
File "/home/tim/.virtualenvs/tempenv-7cc217326033a/lib/python3.4/site-packages/gitpylib/common.py", line 50, in git_call
out = out.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 969175: invalid start byte
Maybe something like this:
7 additions | +++++++ (pluses in green)
4 deletions | ---- (minuses in red)
(the diff follows...)
@@ -0,0 +1 @@
....
Check out the --numstat
flag of git diff
Will happen if the user did, for example, a git mv
.
$ gl commit
✘ Some internal error occurred
➜ If you want to help, see http://gitless.com for info on how to report bugs and include the following information:
0.8.3
Traceback (most recent call last):
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.gl", line 69, in main
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.gl_commit", line 51, in main
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.commit_dialog", line 61, in show
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.commit_dialog", line 71, in _launch_editor
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/subprocess", line 522, in call
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/subprocess", line 710, in __init__
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/subprocess", line 1335, in _execute_child
OSError: [Errno 2] No such file or directory
If file foo
was modified in branch a
and at the same time removed in branch b
, then after doing a gl {rebase, merge} b
gl status
will note the conflict but just say:
foo (with conflicts)
It should say something more informative like
foo (with conflicts -- modified in a, removed in b)
I switched from master to a branch with gl switch other-branch
, but forgot to pass the -mo
flag. Now I am in other-branch with a clean directory.
Can I bring in the unstaged changes from master into other-branch?
Do I have to switch back and forth and pass the -mo
flag, or is there an simpler command?
It seems that mixing gl
and git
might not be the best idea when branching (for those used to git).
$ gl remote show origing
# Couldn't reach remote origing
# (make sure that you are still connected to the internet)
# (make sure that you still have permissions to access the remote)
Should actually say something like 'origing' doesn't exist, etc...
Files and directories in a .gitignore are associated with branches. That is, if I modify files in an ignored directory in branch1
, then switch to branch2
, my changes will not be reflected in branch2
. This can also cause problems when switching back to plain old git, as ignored files persist. So if I, following the previous gl
commands, switched to branch1
with $ git checkout branch1
the modifications in the ignored directory will be lost.
The following code should replicate the bug.
$ mkdir example
$ cd example
$ gl init
# Local repo created in '/Users/isaac/Documents/tmp/example'
$ echo "leave me alone" > ignored.txt
$ echo "ignored.txt" > .gitignore
$ gl track .gitigore
# File .gitignore is now a tracked file
$ gl commit -m "Added .gitignore"
# Commit succeeded
$ gl branch -c new
# Created new branch "new"
$ ls
ignored.txt
$ gl switch new
# Switched to branch new
$ ls
$
Git has crude provisions for submodules. Maybe gitless can sanitize the use of submodules too. Take good care (better than git) of the branch of the submodule. Also don't use different names for submodule operations as for the main repo operations, like git does.
UI color set to auto
causes GL Version: 0.8.2 to error out with the Message that Failed to parse 'auto' as a boolean value
.
But I had my global git config like so
[color]
ui = auto
which seems totally reasonable, as it is stated here:
https://www.kernel.org/pub/software/scm/git/docs/git-config.html:
[...] use color, to true or auto (this is the default since Git 1.8.4) if you want such output to use color when written to the terminal.
I think this is just a minor thing to fix. You should avoid using repo.config.get_bool('color.ui')
in https://github.com/sdg-mit/gitless/blob/master/gitless/cli/gl.py#L39
In a directory with a .git, gl status
gives me:
On branch gh-pages, repo-directory //
Tracked files with modifications:
➜ these will be automatically considered for commit
➜ use gl untrack f if you don't want to track changes to file f
➜ if file f was committed before, use gl checkout f to discard local changes
.gitignore
... plus all other files
Untracked files:
➜ these won't be considered for commit
➜ use gl track f if you want to track changes to file f
There are no untracked files to list
This is a surprise as I thought everything had been committed, anyhow let's
do gl diff
:
! No diffs to output for .gitignore
etc etc for all the other files.
I appear to be being told that all files are out of date, but there are no diffs?
https://github.com/sdg-mit/gitless/blob/master/LICENSE.md says:
Copyright (C) 2013 Santiago Perez De Rosso
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
As per https://www.gnu.org/licenses/gpl-howto.html you should include a copy of the GPL text, e.g. as the LICENSE file itself?
List their branches
-e
option is already taken in git
, which may create confusion when switching back and forth. How about -x
instead?
Show colored output if color.ui is True.
I get this when trying to commit with gl commit -exc known-good -m ...
# Oops...something went wrong (recall that Gitless is in beta). If you want to help, re port the bug at http://gitless.com/community.html and include the following in the emai l: GL Version: 0.5 Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/gitless/cli/gl.py", line 69, in main return SUCCESS if args.func(args) else ERRORS_FOUND File "/usr/local/lib/python2.7/site-packages/gitless/cli/gl_commit.py", line 48, in main if not _valid_input(only_files, exc_files, inc_files): File "/usr/local/lib/python2.7/site-packages/gitless/cli/gl_commit.py", line 145, in _valid_input f = file_lib.status(fp) File "/usr/local/lib/python2.7/site-packages/gitless/core/file.py", line 211, in status return _status(fp)[0] File "/usr/local/lib/python2.7/site-packages/gitless/core/file.py", line 286, in _status git_s = git_status.of_file(fp) File "/usr/local/lib/python2.7/site-packages/gitpylib/status.py", line 55, in of_file return _status_from_output(s, _is_au_file(fp), fp) File "/usr/local/lib/python2.7/site-packages/gitpylib/status.py", line 129, in _is_au_file raise Exception('Unexpected output of ls-files: {0}'.format(out)) Exception: Unexpected output of ls-files: H known-good/.gitignore H known-good/Makefile H known-good/independent/c-4df500fa93a8e8f5886b3590424a7aa67e21bf0e.tar.gz H known-good/make-known-good
Note that the "unexpected output" is comming from the directory that I'm trying to exclude from the commit.
The documentation says that a remote branch will be created if it doesn't exist, but that's not what I'm seeing:
12:35:11 $ gl publish origin/fix/migrations
# Branch "fix/migrations" doesn't exist in remote "origin"
Way to reproduce:
$ mkdir tmp && cd tmp
$ gl init
$ echo 'f' > f
$ gl track f
# File f is now a tracked file
$ gl untrack f
# File f is now an untracked file
$ gl untrack f
# File f is now an untracked file
The expected behavior is for that file to become a tracked file.
The problem is that since there are no commits, HEAD
can't be resolved. Gitless should do a git rm --cached
instead of git reset
in this case.
man gl
should work
For example, this one is fine:
# (use gl track <f> if you want to track changes to file f)
But this one is not:
# (to remove a remote do gl remote rm remote_name)
I'm using git-crypt (which uses clean/smudge filters) to encrypt some files in all my repos, and gitless always displays the encrypted files as having modifications, even though they don't. I'm afraid it will mess them up if I try to commit, so I don't use gitless, even though I would really like to. Is there perhaps an easy fix for this?
The current way of installing Gitless (via pip
) is kind of a pain for users that don't use Python
Should say something more than what is printed when not doing an init from a remote repo.
$ gl status
On branch master, repo-directory //gltest
✘ Some internal error occurred
➜ If you want to help, see http://gitless.com for info on how to report bugs and include the following information:
0.8
Traceback (most recent call last):
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.gl", line 69, in main
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.gl_status", line 44, in main
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.core", line 561, in status
OSError: Failed to open directory '/Users/stefan/Library/Saved Application State/com.bitrock.appinstaller.savedState/': Permission denied
# Oops...something went wrong (recall that Gitless is in beta). If you want to help, report the bug at http://gitless.com/community.html and include the following information:
0.6.2
Traceback (most recent call last):
File "/home/benenson/.local/lib/python3.2/site-packages/gitless/cli/gl.py", line 73, in main
return SUCCESS if args.func(args) else ERRORS_FOUND
File "/home/benenson/.local/lib/python3.2/site-packages/gitless/cli/gl_rebase.py", line 35, in main
if sync_lib.abort_rebase() is sync_lib.REBASE_NOT_IN_PROGRESS:
File "/home/benenson/.local/lib/python3.2/site-packages/gitless/core/sync.py", line 121, in abort_rebase
git_sync.abort_rebase()
File "/home/benenson/.local/lib/python3.2/site-packages/gitpylib/sync.py", line 118, in abort_rebase
common.safe_git_call('rebase --abort')
File "/home/benenson/.local/lib/python3.2/site-packages/gitpylib/common.py", line 40, in safe_git_call
raise Exception('%s failed: out is %s, err is %s' % (cmd, out, err))
Exception: rebase --abort failed: out is , err is No rebase in progress?
If I do the following:
myrepo/$ <edit myfile.py>
myrepo/$ cd somedir
myrepo/somedir/$ gl status
It says there are no tracked files, even though if I cd ..
it will (correctly) show me that myfile.py has been changed. Is it by design that the committed files are different depending on the directory I run commit in?
Hi, I'm using the gl-v0.8.3-darwin-x86_64 bin from the main website. Using gl status and gl branch results in the following error:
Traceback (most recent call last):
File "", line 14, in
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.gl", line 80, in main
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.pprint", line 80, in err
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/gitless.cli.pprint", line 40, in puts
File "/Users/santiago/Documents/code/gitless/build/gl/out00-PYZ.pyz/clint.textui.colored", line 52, in func_help
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2718' in position 0: ordinal not in range(128)
Perhaps I missed something in the installation? Just moved the downloaded bin to my /usr/local/bin.
In comparison why not to drop -o
argument? git
behavior seems intuitive.
# Oops...something went wrong (recall that Gitless is in beta). If you want to help, report the bug at http://gitless.com/community.html and include the following information:
0.6.2
Traceback (most recent call last):
File "/home/benenson/.local/lib/python3.2/site-packages/gitless/cli/gl.py", line 73, in main
return SUCCESS if args.func(args) else ERRORS_FOUND
File "/home/benenson/.local/lib/python3.2/site-packages/gitless/cli/gl_history.py", line 41, in main
puts(l, stream=tf.write)
File "/home/benenson/.local/lib/python3.2/site-packages/clint/textui/core.py", line 68, in puts
stream(_str)
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2019' in position 9: ordinal not in range(256)
Collecting gitless
Downloading gitless-0.8.3.tar.gz
Collecting pygit2==0.23.0 (from gitless)
Downloading pygit2-0.23.0.tar.gz (453kB)
100% |████████████████████████████████| 460kB 627kB/s
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/pygit2.egg-info
writing requirements to pip-egg-info/pygit2.egg-info/requires.txt
writing pip-egg-info/pygit2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/pygit2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/pygit2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/pygit2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
pygit2/__pycache__/pygit2_cffi_a5f264a5xe8494016.c:208:10: fatal error: 'git2.h' file not found
#include <git2.h>
^
1 error generated.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-E5tTzm/pygit2/setup.py", line 197, in <module>
cmdclass=cmdclass)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 195, in run
self.find_sources()
File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 222, in find_sources
mm.run()
File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 306, in run
self.add_defaults()
File "/usr/local/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 335, in add_defaults
sdist.add_defaults(self)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/sdist.py", line 120, in add_defaults
build_py = self.get_finalized_command('build_py')
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/usr/local/lib/python2.7/site-packages/setuptools/command/build_py.py", line 33, in finalize_options
orig.build_py.finalize_options(self)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_py.py", line 46, in finalize_options
('force', 'force'))
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 298, in set_undefined_options
src_cmd_obj.ensure_finalized()
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/private/tmp/pip-build-E5tTzm/pygit2/setup.py", line 103, in finalize_options
ffi, C = get_ffi()
File "pygit2/_utils.py", line 107, in get_ffi
include_dirs=[libgit2_include], library_dirs=[libgit2_lib])
File "/usr/local/lib/python2.7/site-packages/cffi/api.py", line 433, in verify
lib = self.verifier.load_library()
File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 113, in load_library
self._compile_module()
File "/usr/local/lib/python2.7/site-packages/cffi/verifier.py", line 210, in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
File "/usr/local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 29, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose)
File "/usr/local/lib/python2.7/site-packages/cffi/ffiplatform.py", line 62, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError: CompileError: command 'clang' failed with exit status 1
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.