Giter Club home page Giter Club logo

git-recall's Introduction

git-recall

Simple and handy tool to easily recall what you've done

git recall

Purpose

git-recall is a simple tool that allows you to easily go through your commits and check what you or other contributors in your team did. It doesn't aim to be a replacement for the git log command, but just to be a convenient way to recall what you've done from your terminal.

Usage

$ git recall   [-a <author name>]
               [-d <days-ago>]
               [-b <branch name>]
               [-p <paths>]
               [-f]
               [-h]
               [-v]
Options description:
  • -a - Restrict search for a specific user (use -a "all" for all users)
  • -d - Display commits for the last n days
  • -b - Specify branch to display commits from
  • -p - Specify path/s or file/s to display commits from
  • -f - Fetch the latest changes
  • -h - Show help screen
  • -v - Show version
How to use:

Once the commits are displayed, you can use either the arrow keys or j/k to switch between commits, press TAB or e to expand/reduce the commit's diff or q to quit.

Limitations:

when the number of lines between the commits list and a commit's diff is higher than the current terminal session's number of lines, the result will be displayed using the less program which will open the diff in a separate screen. You can still use either TAB or q to return to the commits list.

Examples

$ git recall
# By default (without options), the command will display commits from yesterday and
# for the current user.
$ git recall -d 5 -a "Doge"
# The command will show all Doge's commits from 5 days ago.

$ git recall -d 5 -a "all"
# The command will show commits of all contributors from 5 days ago.
$ git recall -f
# Fetch commits beforehand.

Installation

Without using tools

You can install it by simply copying the git-recall script into any existing path (e.g. /usr/local/bin) or create your own directory and add it to the PATH variable.

Make sure to run chmod +x /usr/local/bin/git-recall or the directory in which you copied it to.

Using NPM

Use npm to install the project.

npm install --global git-recall
Manual install

Clone the project and install it using make install.

$ git clone https://github.com/Fakerr/git-recall.git
$ cd git-recall
$ sudo make install

Requirements

  • OS: Linux or OSX
  • Bash 4.3 or more
  • Tools: git, less, sed
Optional Requirements
  • For a better UX, it's recommended to have installed the lesskey program.

Contribution

Pull requests are welcome, along with any feedback or ideas.

License

MIT

git-recall's People

Contributors

expobrain avatar fakerr avatar jong avatar josh-byster avatar kiela avatar ronaldfindling avatar ryanc414 avatar seanmcn avatar teszko 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-recall's Issues

Add option to disable line wrapping

Hi there,

Is it possible to disable line wrapping on the log output? During my usage, I've found merge commits in particular have longer commit titles which are occasionally wrapping. This makes the log more difficult to read/navigate.

Fantastic tool, use this every day ๐Ÿ‘

Doesn't work in rxvt; just reprints list of commits

In rxvt-unicode 9.22 on FreeBSD 11.0 (using zsh and /bin/sh) git recall prints the commits, but hitting j/k/Up/Down just prints out the same commits once more. No commit is marked like in the gif at any time. Tab has a similar effect of partial reprint of the lines.

File option?

Would love if this could be passed a single file to git-recall on.

Arrow keys to navigate do not work

System: macOS 10.12.1

I can run git-recall but I cannot move up and down the commit list with the arrow keys. The j/k keys do work correctly.

I get an abort error

I installed it through npm but when i try to run git recall i get the following error

abort: the program lesskey is not installed. Make sure to install it before running git-recall

lesskey is not installed,

I'm getting this error:
abort: the program lesskey is not installed. Make sure to install it before running git-recall

How dow I install lesskey? can't seem to find a way to install it

Tab expansion not working

OS: Mac OS 10.11.6
Bash: 3.2.57
[email protected]

Pressing tab on a commit only duplicates the 'commit row' below the line that I pressed tab upon.

Expected: Upon pressing tab, the expanded commit information should show below the current selected commit.

Escape characters in diff view are not reproduced literally

Escape characters (at least newline \n) in the diff view of git-recall seem to be interpreted rather than echoed literally. It's easiest to show with an example:

Expected behavior (output of git diff):

-        char write_char = buf[write_len++];
+        const char write_char = buf[write_len++];
 
-        if (write_char == '\n') {
+        if (write_char == CHAR_LF) {

Actual behavior (using git reacall, after selecting a diff SHA and pressing enter):

-        char write_char = buf[write_len++];
+        const char write_char = buf[write_len++];
 
-        if (write_char == '
') {
+        if (write_char == CHAR_LF) {

This behavior occurs on v1.1.2 (haven't used any earlier versions, so unsure if this is a regression or not).

sed: illegal option

System: macOS 10.12.1

When expanding one of the git commits with tab and closing it again the following error is shown:

sed: illegal option -- r various tweaks (3 days ago) <myname>
usage: sed script [-Ealn] [-i extension] [file ...] ago) <myname>

git recall --help argument issues error

Instead of getting help, I get this message:

No manual entry for git-recall
See 'man 7 undocumented' for help when manual pages are not available.

git recall -h and git-recall --help works, though

git-recall 1.2.4
git version 2.7.4 on Ubuntu 16.04.4 LTS

pass arguments to git-log

it might be a good idea to keep the standard git-log bahavior and just pass arguments to git log instead of limiting the functionality and setting non-standard default values like it's done for -d and -a.
I can see the need for --abbrev-commit and --pretty=format:'${GIT_FORMAT}' but otherwise it would be nice to make it behave like git-log does with its
git log [<options>] [<revision range>] [[--] <path>...] scheme.
If you insist on keeping the default behavior as it is right now, it would at least be nice to be able to pass arguments to git log. I think it would simplify the program a lot.

Cannot navigate with arrows in terminal on macOS

Installed git-hlog by copying the script to /usr/local/bin and chmod u+x on it.

The command works,

Navigated to a folder with a git repo with history, typed:

git hlog -d 10

It shows me commits from the last 10 days. However, there is a warning at the top of the output:

/usr/local/bin/git-hlog: line 134: lesskey: command not found

I cannot navigate down the commits with the arrow keys whatsoever. On top of that, hitting tab expands the commit but overlaps everything in the window (zsh or bash exhibit the same behavior in the vanilla Terminal app on mac).

Quitting out prints this to terminal:

rm: /Users/kevinquillen/.lsh_less_keys_tmp: No such file or directory

Doing which lesskey results in lesskey not found which is likely why this isn't working for me at the moment.

Looks like a great tool otherwise and would love to get this working!

line break results in broken redraw

Hello,
if a line exceeds the terminal width, it results in the first line not being removed on redraw and piling up every time you move the cursor.
Tested on Debian Jessie (8.7)
ncurses 5.9
less 458
reproducible in both gnome-terminal and terminator

git-recall_bug1

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.