julien040 / gut Goto Github PK
View Code? Open in Web Editor NEWA beginner friendly porcelain for git
Home Page: https://gut-cli.dev
License: MIT License
A beginner friendly porcelain for git
Home Page: https://gut-cli.dev
License: MIT License
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
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
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)
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)
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:
gut squash
Expected behavior
squash
should be able to squash the first two commits into one.
Desktop (please complete the following information):
You may like to know that ArchLinux users can install gut
from AUR:
The aur/gut
package will fetch the source, compile it, and install it:
yay -S gut
The aur/gut-bin
will fetch a binary appropriate for the actual architecture and install it:
yay -S gut-bin
Cheers.
This โissueโ is purely informational, you may close it at your discretion โ no action is necessary.
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.
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).
The init
function must only be called when needed (a profile is required).
Ability to squash the last n commits and sync that to the remote
Describe the bug
Since 0.2.9, gut
started deleting files that aren't tracked by git
Expected behavior
Gut should leave the untracked files and don't do anything with them
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?
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
Describe the bug
I don't know (or can't remember) which version of gut
is currently installed. This means that:
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)
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.
gut sync
should adapt his behaviour following if the branch is ahead, behind or diverged.
Push to the remote
Pull the changes
Prompt the user to choose between:
Provide shell completions to have tab completions for gut commands
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
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
Perhaps on some distros, the collection "login" isn't available. So it fails to unlock it
Describe the bug
When gut fails, it prints to Stdout
Expected behavior
Gut should rather print to Stderr
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.
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):
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.)
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
To be closer to git
's behaviour, gut switch
should be able to switch to a commit and tags
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.