Coder Social home page Coder Social logo

gitupdate's Introduction

GitUpdate Thanks

Commit and push updated files with file names as commit message

Install

go install github.com/nikitavoloboev/gitupdate@latest

Usage

You can either use it by passing it a file path (with git repo) that you want to commit. i.e.

gitupdate /Users/nikivi/src/cli/gitupdate

Or if you are already in the git directory you want to commit, run:

gitupdate .

This will add all files that have changed since last commit and will include all the file names (without extension) as the commit message. Example use.

If you want to only consider top level folders for the commit message, use the --top (or -t for short) flag.

I personally find it very useful for personal repos where commits are not that important (i.e. notes/dotfiles/docs). I treat these repos as write only so there is no point in wasting time writing a commit message.

Run

  1. Clone repo
  2. If you use VSCode with Go plugin, it will install all Go dependencies for you in the background when you open the project.
  3. Edit the code & run it with go run ..

I use watchexec to develop.

Running watchexec --exts go "echo -- && go run ." will automatically rerun go run . for you on every Go file changed.

Contribute

Have idea how to improve or something is broken?

Search for existing issues or open new one.

PRs with code/docs changes are welcome.

Thank you

You can support me on GitHub or look into other projects I shared.

I also have personal Discord you can join for more indepth discussions.

MIT Twitter

gitupdate's People

Contributors

bowernite avatar jletey avatar nikitavoloboev avatar roryokane avatar skibitsky 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

gitupdate's Issues

Installation instructions to run go get don't work

Bug ๐Ÿž

Running go get -u github.com/nikitavoloboev/gitupdate fails with following error:

go: go.mod file not found in current directory or any parent directory.
	'go get' is no longer supported outside a module.
	To build and install a command, use 'go install' with a version,
	like 'go install example.com/cmd@latest'
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'.

Running following does work:

go install  github.com/nikitavoloboev/gitupdate@latest
โžœ  ~ go version
go version go1.18.3 darwin/arm64

Allow setting a commit message prefix

Feature โœจ

gitupdate -p "Update " . # `Update foo bar baz`
gitupdate --prefix "Update " .

Why?

I have a global githook that, among other things, verifies if the commit message begins with an uppercase letter. In the absence of this option, gitupdate doesn't work with my githook (it emits an obscure error message).

Idea: Add functionality for just commiting

Feature โœจ

Modify the command in some way to allow just the commit aspect, without pushing.

Rationale

Right now, the command takes 3-5 seconds, and I assume that's because gitupdate pushes no matter what.

In cases where I don't really care to push right now, and just want a quick commit, it'd be nice to have it be quicker. Whether that means adding a CLI flag like -c or -n, or changing the default and having consumers do gitupdate . && git push and/or setting up a shell alias for it.

Maybe I'll just get used to the behavior, but at least wanted to make an issue for it and bring it up for discussion.

Verbose flag

Would be nice to be able to pass a -v where is prints what it is doing.

Push

This assumes we are working on a repo with remotes where we want to push. If it's not the case, it commits but exits with error 128

It should be possible for the user to specify if he wants to push or not.

Unique commit messages

If I'm working on the same files and doing these temp commits, I guess the commit message would always be the same? It'd be awesome to add some uniqueness to commit messages to easily differentiate them. For example:

5dcc0a0 my-cool-script ๐Ÿ‘ ๐ŸŒด ๐Ÿ˜ 
331c87a my-cool-script ๐Ÿ“‚ ๐Ÿ‘‰ ๐Ÿ˜œ
1d7d0a4 my-cool-script ๐Ÿ”… ๐Ÿ˜ป ๐Ÿšถ
bbdfb9a my-cool-script ๐Ÿ… ๐Ÿ™‰ ๐ŸŽฃ
612a7d6 my-cool-script

gitupdate not found after install in ubuntu

Steps to Reproduce:

  1. check ig go is installed
 sudo apt install golang-go
[sudo] password for joe:
Reading package lists... Done
Building dependency tree
Reading state information... Done
golang-go is already the newest version (2:1.13~1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1. install gitupdate
    go get -u github.com/nikitavoloboev/gitupdate

  2. go to git project folder and execute

cd ~/.projectfiles
gitupdate .
gitupdate: command not found

`Exit status 1` for dotfile

To reproduce

  1. Make change to file with path .zshrc (i.e., in root of git repo)
  2. $ gitupdate

Result:

2020/12/16 19:09:56 exit status 1

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.