Coder Social home page Coder Social logo

gitin's People

Contributors

fatih avatar isacikgoz avatar jeroenknoops avatar reobin avatar saromanov avatar ss18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitin's Issues

Terminal's line-wrapping is changed

When I enter gitin, it sets the terminal to not wrap lines. It fails to revert back to the old state when quitting gitin, however.

I use version 0.1.0 installed via Homebrew on macOS 10.14.2 (Mojave).

More detailed description:

Open a terminal with a shell prompt. Navigate to the root of a git clone. Type the following command:

echo $PWD $PWD $PWD $PWD $PWD $PWD

Assuming this prints a line longer than the terminal width, you will observe that the line is wrapped around to the next screen line. (This is the default terminal behavior, as far as I know.) (Add more $PWD if the line is too short for wrapping.)

Now invoke gitin status. Wait for its output to appear. Hit q to quit.

Now repeat the above echo command, and observe that the line is no longer wrapped. Instead, it is cut off.

The expected behavior is that the line wraps, just like it did before I invoked gitin status.

I can now type reset at the terminal and then repeat the echo command again, and now it wraps properly.

I tested this with iTerm2 and with the built-in Terminal app, with the same results.

Installer fails when trying to apply patch

claussen@ohle:~/gocode/src/github.com/isacikgoz/gitin $ make install
git submodule -q foreach --recursive git reset -q --hard
git submodule update --init --recursive
if patch --dry-run -N -d /home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27 -p1 < git2go.v27.patch >/dev/null; then \
		patch -d /home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27 -p1 < git2go.v27.patch; \
	fi
/bin/sh: git2go.v27.patch: No such file or directory
make -C /home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27 install-static
make[1]: Entering directory `/home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27'
./script/build-libgit2-static.sh
+ VENDORED_PATH=vendor/libgit2
+ cd vendor/libgit2
+ mkdir -p install/lib
+ mkdir -p build
+ cd build
+ cmake -DTHREADSAFE=ON -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../install ..
CMake Error: The source directory "/home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27/vendor/libgit2" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
make[1]: *** [build-libgit2] Error 1
make[1]: Leaving directory `/home/claussen/gocode/src/gopkg.in/libgit2/git2go.v27'
make: *** [build-libgit2] Error 2

Stray "q" after quitting `gitin status` and `gitin log`

Navigate to the root of a git repository. Run gitin status. Hit q to quit. Observe that a stray "q" is printed before the next shell prompt.

For example, after PS1='> ' (in bash), I see this:

> gitin status
q>

(It also happens with my default prompt, I just used a really simple prompt to clarify.)

Only works from git repo's top level dir

gitin fails when you dont execute from the the top level git path.

could not find repository from '/home/user/gitproject/some/sub/dir/'

Would be useful to walk the folder tree backwards to look for a git repo.

Add colour coding on gitin branch command

The git branch -a command shows local branches in white, remote branches in red, and the currently checked out branch in green.

git branch -a

It think the gitin branch could make good use of that colour coding.

Thanks for what you're doing with gitin, it makes my everyday git flow a lot neater!

Issues with installing gitin

When installing, it errors out:

~ > go get -u github.com/isacikgoz/gitin
# github.com/libgit2/git2go
go/src/github.com/libgit2/git2go/git_dynamic.go:10:3: error: #error "Invalid libgit2 version; this git2go supports libgit2 v0.27"
   10 | # error "Invalid libgit2 version; this git2go supports libgit2 v0.27"
      |   ^~~~~

Show Author and Tags in `gitin log`

Hi,
I really like gitin and I consider it as a replacement for tig. However, tig shows also the commit author and the tags in the commit overview. Especially the tags are very important to quickly see which commits made it into a release.

Keep on rocking with gitin!

[Feature Request] Keep search results when back to commit list

It would be cool if it's possible to keep search results when back to commits list. For ex:

gitin log -> type "/" -> type "add" -> arrow up/down -> enter 1 commit -> type "q" back to commits list

In this case, it shows the original commits list without applying search "add".

It would be cool to have the possibility to go back to the list with applying search "add". Maybe a hotkey "backspace" to go back to the filtered list?

[Bug] Dirty exit after back from viewing commit

Reproduce steps:

  1. go into a repo
  2. issue gitin log
  3. press enters to reach open a commit in view mode with less
  4. press qs to quit to shell.

expected behavior is that we need only three q to exit from commit view mode but it actually took more, 4-5 q to exit.

after step 3, if I try to scroll using ctrl-n or ctrl-p it will print out chars after Date: ^N^N^N^P^P^P^N^N^N^Nqqq^C - ^C to force exit gitin.

Lines cut off when viewing diff of file

When I do gitin status and then select a file, or gitin log and then select a commit and then a file, in both cases it looks like I'm viewing the diff with less. But long lines are cut off, and I can't scroll right, either. I tried -S in less, thinking that would start wrapping lines, but it didn't work, either.

I'm sorry that my code base has such long lines, but nevertheless I have to live with it, so I'd like to see the right hand end of the line in my diff output, too.

Add support searching by commit id

It'd be really nice if I could just type in part of the commit hash (instead of commit message) and gitin log be able to find it. This is a simple task I perform daily and gitin does not seem to support it yet.

Do you plan to add this kind of feature?

Thanks and good job!

Error installing

Run through the steps until this step:

$ make install
git submodule -q foreach --recursive git reset -q --hard
git submodule update --init --recursive
if patch --dry-run -N -d /home/ant/go/src/gopkg.in/libgit2/git2go.v27 -p1 < patch/git2go.v27.patch >/dev/null; then \
        patch -d /home/ant/go/src/gopkg.in/libgit2/git2go.v27 -p1 < patch/git2go.v27.patch; \
fi
patching file script/build-libgit2-static.sh
make -C /home/ant/go/src/gopkg.in/libgit2/git2go.v27 install-static
make[1]: Entering directory '/home/ant/go/src/gopkg.in/libgit2/git2go.v27'
./script/build-libgit2-static.sh
+ VENDORED_PATH=vendor/libgit2
+ cd vendor/libgit2
+ mkdir -p install/lib
+ mkdir -p build
+ cd build
+ cmake -DTHREADSAFE=ON -DBUILD_CLAR=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../install -DUSE_EXT_HTTP_PARSER=OFF -DUSE_HTTPS=OFF -DUSE_NSEC=OFF -DUSE_SSH=OFF -DCURL=OFF -DUSE_GSSAPI=OFF -DUSE_BUNDLED_ZLIB=ON ..
./script/build-libgit2-static.sh: 11: ./script/build-libgit2-static.sh: cmake: not found
Makefile:11: recipe for target 'build-libgit2' failed
make[1]: *** [build-libgit2] Error 127
make[1]: Leaving directory '/home/ant/go/src/gopkg.in/libgit2/git2go.v27'
Makefile:34: recipe for target 'build-libgit2' failed
make: *** [build-libgit2] Error 2

first key is ignored after return back to log prompt

This is a known bug, and need some help to resolve it.

Since promptui uses readline to catch keyboard inputs, it does not close to input even though I close the readline here

go func() {
	if <-b {
		sb.Clear()
		sb.Flush()
		rl.Write([]byte(showCursor))
		rl.Close()
	}
}()

Dies pretty quickly in some project directories

I'm on a Macbook Pro, Mojave, 10.14.2 (18C54).

In some git projects, running gitin log, or even git -h, results in an error

could not find repository from '/Users/myusername/Projects/myproject'

Any other git tool (like tig) works fine. It's not all projects, just some, which is odd.

I've narrowed it down to line 61, in gopkg.in/libgit2/git2go.v27/repository.go, which is this call into C code

ret := C.git_repository_open(&ptr, cpath)

This happened with both the release download, and with a version I built following the build instructions.

If I can provide any more info, please let me know.

feat(log): Add key shortcut to copy commit hash

Something like y or c would be super useful to quickly copy the commit hash when using gitin log

I'm willing to work on this when I have some free time. In the meantime, if anyone wants to have a go at it, it's super appreciated too.

[Feature Request] - Flag to list branches by date

From the looks of it, it appears that the branches are organized alphabetically. It would be great to add a flag to sort them with latest at the top of the list.

Also since it shows remote branches as well, having another flag to show only local branches would be nice.

Great tool!

interactive hunk staging

The one feature that still makes tig essential for me is interactive hunk staging, i.e. staging hunks from the diff view.

In tig, one can even stage (or un-stage) single lines.

Panic when selecting on empty search result

Reproduce:
gitin log
/
type in some gibberish returning no results
<enter>

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/isacikgoz/gitin/prompt.(*Log).onSelect(0xc0000d4500, 0xc0000e3d50)
	/Users/ibrahim/git/gitin/prompt/log.go:62 +0x3be
github.com/isacikgoz/gitin/prompt.(*prompt).assignKey(0xc0000a8140, 0xc00000000a, 0x2)
	/Users/ibrahim/git/gitin/prompt/prompt.go:203 +0xee
github.com/isacikgoz/gitin/prompt.(*prompt).innerRun(0xc0000a8140, 0x4432ab0, 0xc0000a8140)
	/Users/ibrahim/git/gitin/prompt/prompt.go:143 +0x19f
github.com/isacikgoz/gitin/prompt.(*prompt).start(0xc0000a8140, 0x0, 0x0)
	/Users/ibrahim/git/gitin/prompt/prompt.go:111 +0x241
github.com/isacikgoz/gitin/prompt.(*Log).Start(0xc0000d4500, 0xc0000d8cc0, 0x4399800, 0xc0000f0190)
	/Users/ibrahim/git/gitin/prompt/log.go:55 +0x3fd
main.run(0x442272b, 0x3, 0xc000016104, 0x32, 0x4, 0xc0000ea3f0)
	/Users/ibrahim/git/gitin/main.go:71 +0x29e
main.main()
	/Users/ibrahim/git/gitin/main.go:24 +0x69

I think this is unsafe accessing here: https://github.com/isacikgoz/gitin/blob/master/prompt/log.go#L62

Awesome tool! This is pretty low priority I think but would be cool to handle it nicer!

Unable to install from AUR of Manjaro

When I tried to install gitin from AUR of Manjaro, there is error:

$ pacui i gitin
==> Error: Could not find all required packages:
    libgit2=1:0.27.8 (Wanted by: gitin)
    libgit2-glib=0.27.8 (Wanted by: gitin)

https://aur.archlinux.org/packages/gitin page says I have to downgrade my libgit2 to 0.27.8, but my current installed version is libgit2=1:1.0.0-1

There was another issue mentioning this libgit2 problem, like #57 , does gitin really have to use exactly libgit2=1:0.27.8 and libgit2-glib=0.27.8?

Error sounds play when exploring `gitin log`

Using iTerm, and installed via brew

I went straight into a repo and ran gitin log and used the arrow keys to explore. Interaction proceeded as expected, but every arrow key press triggered a sound from MacOS for an invalid interaction in the terminal.

gitin_0.1.0_linux_amd64.tar.gz release isn't a self-contained static binary, has runtime dependency on libssl.so.1.1

the linux release gitin_0.1.0_linux_amd64.tar.gz is not self-contained, has runtime dependencies on dynamic libraries (e.g. libssl.so.1.1 )

steps to reproduce

  1. obtain a standard test environment without dev dependencies, e.g. a debian jessie slim container

  2. download binary release https://github.com/isacikgoz/gitin/releases/download/v0.1.0/gitin_0.1.0_linux_amd64.tar.gz

  3. untar the gitin

  4. add the gitin to the PATH

  5. run gitin --version

expected behaviour

gitin exits successfully after displaying version number

observed behaviour

gitin: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

dockerfile to reproduce

docker build -t gitin_static:dev -f test.Dockerfile .

where test.Dockerfile contains

FROM debian:jessie-20190122-slim

RUN apt update
RUN apt install -y wget

WORKDIR /tmp
RUN wget --quiet https://github.com/isacikgoz/gitin/releases/download/v0.1.0/gitin_0.1.0_linux_amd64.tar.gz
RUN tar -xvzf gitin_0.1.0_linux_amd64.tar.gz
RUN mkdir -p /tmp/bin
RUN mv gitin /tmp/bin/gitin
ENV PATH="$PATH":/tmp/bin/

RUN gitin --version

proposed cause

git2go links to libgit2, which in turn links to various dependencies for ssh support, http support, etc. it seems like these latter dependencies tend to be linked dynamically, even if you use the scripts and documentation provided by git2go to do a "static" build of git2go.

suggested fix

if the gitin application does not actually require ssh or http support, you can customise build flags of libgit2 when compiling git2go to disable linking to these unnecessary dependencies.

libgit2 build flags that can be customised are here: https://github.com/libgit2/libgit2/blob/master/CMakeLists.txt#L58

i suggest disabling USE_SSH, USE_HTTPS, and USE_EXT_HTTP_PARSER (these are all educated guesses based on the option name)

one way to do this is by modifying: https://github.com/libgit2/git2go/blob/master/script/build-libgit2-static.sh

pass these additional flags to cmake: -DUSE_SSH=OFF -DUSE_HTTPS=OFF -DUSE_EXT_HTTP_PARSER=OFF after the -DBUILD_SHARED_LIBS=OFF flag.

then, to build git2go run this modified script/build-libgit2-static.sh .

the gitin application should still link against this new static git2go library if built using --tags static (as it looks like it is currently built)

(this fix may not be 100% accurate, it's from memory -- i spent a few hours earlier today trying to figure how to do self-contained static builds for my own application that depends on git2go)

Installer doesn't work if GOPATH contains multiple entries

Your installer doesn't work if GOPATH contains multiple entries:

$ echo $GOPATH
/home/martin/go:/home/martin/work

It tries to run stuff like:

patch -d /home/martin/go:/home/martin/work/src/gopkg.in/libgit2/git2go.v27 -p1 < git2go.v27.patch

The solution is to change this:

GOPATH_DIR:=$(shell go env GOPATH)

To something like:

GOPATH_DIR:=$(shell go env GOPATH | cut -d: -f1)

(but I didn't test this solution at all).

Set up funding ๐Ÿ’ฐ

I feel like this repo could use a little funding through GitHub Sponsors ๐Ÿ˜ฌ Set this up maybe?

Would love to contribute a couple of dollars a month to motivate further development

The next step for gitin

Hi,

With this post, I want to discuss about the next release of gitin. Feel free to bring your ideas. I am considering to merge it this week.

There will be some deprecation on some small features:

  • log, branch commands won't have any sub commands. (If these are requested I can consider to add again, but they seem to be useless)
  • you cannot search for commit hashes anymore, and only search algorithm will be fuzzy search.

I hope the next version be more maintenance friendly and will have much understandable code so that it can encourage more people to contribute.

If anyone has ideas it is time to bring them on the table. Cheers!

Index out of range

No results
qpanic: runtime error: index out of range

goroutine 243 [running]:
github.com/isacikgoz/promptui/list.(*List).Index(0xc0000ac730, 0xc000000071)
	/Users/ibrahim/go/src/github.com/isacikgoz/promptui/list/list.go:204 +0x67
github.com/isacikgoz/promptui.(*Select).innerRun.func1(0xc01b3eefd8, 0x1, 0x1, 0x1, 0xc000000071, 0x)
	/Users/ibrahim/go/src/github.com/isacikgoz/promptui/select.go:340 +0x9a3
github.com/chzyer/readline.(*DumpListener).OnChange(0xc0000a2338, 0xc01b3eefd8, 0x1, 0x1, 0x1, 0x71,)
	/Users/ibrahim/go/src/github.com/chzyer/readline/operation.go:516 +0x63
github.com/chzyer/readline.(*Operation).ioloop(0xc02424b340)
	/Users/ibrahim/go/src/github.com/chzyer/readline/operation.go:339 +0x397
created by github.com/chzyer/readline.NewOperation
	/Users/ibrahim/go/src/github.com/chzyer/readline/operation.go:88 +0x2b1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.