Code Monkey home page Code Monkey logo

gut's People

Contributors

julien040 avatar lemmingavalanche 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

gut's Issues

Feature Request: Support SSH repositories

Support for ssh urls would be a welcome feature.

On which website is your repository hosted?  ssh://localhost:23231/patch
I think this url isn't valid ๐Ÿ˜“. Please type it again
On which website is your repository hosted?  ^C

Err: Reference not found after repo initialisation failed

When a repo is initialized, if the profile creation failed, gut won't work.

Sorry, I can't check if the HEAD is detached ๐Ÿ˜ข
Error message: reference not found

Potential origin

func Init(cmd *cobra.Command, args []string) {
	wd, err := os.Getwd()
	if err != nil {
		exitOnError("Oups, something went wrong while getting the current working directory", err)
	}
	if executor.IsPathGitRepo(wd) {
		exitOnError("Oups, this directory is already a git repository. Delete the .git folder if you want to initialize a new repository", nil)
	}
	err = executor.Init(wd)
	if err != nil {
		exitOnError("Oups, something went wrong while initializing the repository", err)
	}
	profile := selectProfile("", true)
	associateProfileToPath(profile, wd)
	_, err = executor.Commit(wd, "๐ŸŽ‰ Initial commit from Gut")
	if err != nil {
		exitOnError("Oups, something went wrong while creating the first commit", err)
	}
	print.Message("Yeah, your repository is ready to go!", print.Success)

}

This is the function for the command Init in gut.

If selectProfile failed (e.g. pass ins't installed), no initial commit is made ( executor.Commit() is never called).
However, the repo is initialised.
When gut checks if the repo is in detached head, it fails because there isn't any commit (so no HEAD)

apt.gut-cli.dev appears to be down (returns HTTP 404 error)

Attempting to install on Ubuntu 22.04, it appears that apt.gut-cli.dev is down.

Confirmed it's not just me:
https://downforeveryoneorjustme.com/apt.gut-cli.dev?proto=https

Output:

echo "deb [trusted=yes] https://apt.gut-cli.dev /" | sudo tee /etc/apt/sources.list.d/gut.list
sudo apt-get update
sudo apt-get install gut

deb [trusted=yes] https://apt.gut-cli.dev /
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:3 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease
Ign:4 https://apt.gut-cli.dev  InRelease
Ign:5 https://apt.gut-cli.dev  Release
Hit:6 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:7 https://apt.gut-cli.dev  Packages
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Ign:9 https://apt.gut-cli.dev  Translation-en
Get:7 https://apt.gut-cli.dev  Packages
Err:9 https://apt.gut-cli.dev  Translation-en
  404  Not Found [IP: 52.72.60.30 443]
Err:9 https://apt.gut-cli.dev  Translation-en
  404  Not Found [IP: 52.72.60.30 443]
Get:10 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
Err:9 https://apt.gut-cli.dev  Translation-en
  404  Not Found [IP: 52.72.60.30 443]
Err:9 https://apt.gut-cli.dev  Translation-en
  404  Not Found [IP: 52.72.60.30 443]
Err:9 https://apt.gut-cli.dev  Translation-en
  404  Not Found [IP: 52.72.60.30 443]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [508 kB]
Ign:9 https://apt.gut-cli.dev  Translation-en
Err:9 https://apt.gut-cli.dev  Translation-en
  404  Not Found [IP: 52.72.60.30 443]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [508 kB]
Ign:9 https://apt.gut-cli.dev  Translation-en
Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [47.7 kB]
Fetched 896 kB in 4s (219 kB/s)

Out of bound error in gut squash

Describe the bug
Gut returns this when running gut squash

panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
github.com/julien040/gut/src/controller.Squash.func1(...)
        /Users/julien/Code/gut/src/controller/squash.go:98
github.com/julien040/gut/src/controller.Squash(0x14000125000?, {0x10348ce20, 0x0, 0x102e7072b?})
        /Users/julien/Code/gut/src/controller/squash.go:120 +0x8d4
github.com/spf13/cobra.(*Command).execute(0x103405960, {0x10348ce20, 0x0, 0x0})
        /Users/julien/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x640
github.com/spf13/cobra.(*Command).ExecuteC(0x103404de0)
        /Users/julien/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x320
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/julien/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
github.com/julien040/gut/cmd.Execute()
        /Users/julien/Code/gut/cmd/root.go:50 +0x28
main.main()
        /Users/julien/Code/gut/main.go:27 +0x1c

To Reproduce
Steps to reproduce the behavior:

  1. Create a repo with exactly two commits
  2. Don't push any of them to the remote
  3. Run gut squash

Expected behavior
squash should be able to squash the first two commits into one.

Desktop (please complete the following information):

  • OS: macOS
  • Version 0.2.10

Not an issue

Knowing how annoying go-git is to work with because of the incomplete features and caveats this project is very impressive.
Your project documents go-git better than their own documentation.

Thank you.

Performance on Linux - Profile loaded every time

On every commands, the init() function in profile package is called.
On Linux, it runs a bunch of checks (GUI available, pass is installed, etc.).
But these check aren't required on every commands (gut status for instance).

Solution

The init function must only be called when needed (a profile is required).

Dot files in .gitignore not ignored

Discussed in #45

Originally posted by RyanRoberts April 26, 2023
I'm not sure if this is a bug or a feature so I'll stick it here.

Gut seems to display untracked files that I have ignored in my .gitignore file. It only appears to be the Composer vendor directory and a couple of others but not everything.

Is there something I'm likely missing?

Error message: read /data/gitrepos/REPONAME: is a directory

Another error on first time install:

gut init
Do you want to help us improve gut by sending anonymous usage data? (Y/n):  y
โœ” Create a new profile
? Which platform would you like to use ? GitHub
โš  None of your data will leave your computer
                                             
To authenticate with GitHub, please visit the following URL and enter 9B2F-A0B0
https://github.com/login/device
\ I've done my job. Now I'm waiting for you to authenticate with GitHub... ๐Ÿฅฑ- I've done my job. Now I'm waiting for you to authenticate with GitHub... ๐ŸฅฑI've successfully authenticated you with GitHub ๐ŸŽ‰I've successfully got your username from GitHub ๐ŸŽ‰I've successfully got your email(s) from GitHub ๐ŸŽ‰How would you like to call this profile?  I'm sorry but I can't create a profile with a empty name ๐Ÿ˜“How would you like to call this profile?  I'm sorry but I can't create a profile with a empty name ๐Ÿ˜“How would you like to call this profile?  Gutted
I've successfully created your profile ๐Ÿ˜Žwarning: adding embedded git repository: FilterBadRecruiters
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint: 
hint:   git submodule add <url> FilterBadRecruiters
hint: 
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint: 
hint:   git rm --cached FilterBadRecruiters
hint: 
hint: See "git help submodule" for more information.
warning: adding embedded git repository: MyPresentations
warning: adding embedded git repository: WASAuto
warning: adding embedded git repository: eMailSpoofCheck
warning: adding embedded git repository: gmail-add-on-codelab
warning: adding embedded git repository: originalFBR

Oups, something went wrong while creating the first commit
Error message: read /data/gitrepos/FilterBadRecruiters: is a directory
If this error persists, please open an issue on GitHub: https://github.com/julien040/gut/issues/new

Edit: Add code format

A โ€œ--versionโ€ option would be helpful

Describe the bug

I don't know (or can't remember) which version of gut is currently installed. This means that:

  • I don't know which version to report a bug for, and
  • I don't know whether the latest version is installed.

To Reproduce

$ gut --help | grep -i version
	Effortlessly version control your projects with Gut.

Expected behavior

When invoked with the --version option, gut should show me its version (and possibly release or install date). E.g.:

$ gut --version
gut v0.2.6 (2023-04-10)

Enhance gut sync capabilities

Problem

gut sync doesn't work when a branch is diverged.
Because, gut attempts to pull before pushing, any diverged branch is replaced by the remote one.

Solution

gut sync should adapt his behaviour following if the branch is ahead, behind or diverged.

Ahead

Push to the remote

Behind

Pull the changes

Diverged

Prompt the user to choose between:

  • Set local state to the remote one
  • Push force with lease
  • Rebase and set new local changes on top of remote

On headless Linux, Gut couldn't save password

Description

On every attempt to save a password on a headless linux (no graphical interface), gut will fail

Sorry, I can't save the password in the keyring ๐Ÿ˜“
failed to unlock correct collection '/org/freedesktop/secrets/collection/login'
exit status 1

Possible reasons

Gnome keyring unlock

gnome-keyring expects to open a popup to unlock the keyring. However, it couldn't because there isn't any GUI. So it fails to unlock the collection

Default collection login

Perhaps on some distros, the collection "login" isn't available. So it fails to unlock it

Can't auth to github

First time install and after doing the git init, I get/git/gut stuck on authenticating. The script needs to explain to users they need to open a browser to the device url and enter the code displayed in the terminal window. You can't expect someone who doesn't know Git to know this.

Gut on Windows can't get any input

Describe the bug
On Windows, gut can't be used because you can't pass the telemetry consent.
It keeps asking "please enter either y or n".

Expected behavior
Entering "y" should be accounted by gut. Now, it seems like gut receives another input than the one sent

Desktop (please complete the following information):

  • OS: Windows 11

Google's Golang servers don't pick up the version 0.3.0 because there's no 'v' prefix

Describe the bug
This script fetches all Go packages as Golang servers see them:

#!/bin/sh

SINCE=$1 # like 2023-10-31T00:00:00Z

while [ -n "${SINCE}" ]; do

        # download
        echo "downloading SINCE=${SINCE}"
        wget "https://index.golang.org/index?limit=2000&since=${SINCE}" -q -O output-${SINCE}.json

        # get last since
        SINCE_NEW=`tail -1 output-${SINCE}.json | sed -e 's|.*"Timestamp":"||; s|".*||'`

        # EOF?
        if [ "${SINCE_NEW}" = "${SINCE}" ] || [ -z "${SINCE_NEW}" ]; then
                echo "=== End of project list reached @ ${SINCE} ==="
                exit 0
        else
                SINCE=${SINCE_NEW}
        fi
done

For 'gut' it fetches a made-up version:

{"Path":"github.com/julien040/gut","Version":"v0.0.0-20231101182643-8a98fb6c1afe","Timestamp":"2023-11-02T00:49:05.478212Z"}

You need the version to have the 'v' prefix for the server to pick it up.

FreeBSD ports pick Golang sources from Golang servers, so I can't create a FreeBSD port while this problem exists.

(This is idiotic, IMO, but that's how Golang works.)

Feature Request: Enhance switch cmd ability

Keeping changes while switching to an existing branch

If you have uncommited changes, gut won't allow you to switch to an existing branch without discarding your changes.
To remediate this, gut could stash the changes and pop them after switching

Switching to a commit

To be closer to git's behaviour, gut switch should be able to switch to a commit and tags

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.