Cali0707 / git-utils

A collection of useful git tools
Apache License 2.0
3 stars 2 forks source link

Check if jq installed in install.sh #13

Closed Cali0707 closed 11 months ago

Cali0707 commented 11 months ago

Fixes #10

With this change, I am comfortable saying that this supports MacOS as the only dependency needed on mac is jq which we are now testing for in the installation.

Cali0707 commented 11 months ago

@Leo6Leo do you think it would be okay to merge this since the remaining issue is captured in https://github.com/Cali0707/git-utils/issues/16?

Leo6Leo commented 11 months ago

@Leo6Leo do you think it would be okay to merge this since the remaining issue is captured in #16?

if [[ ":$PATH:" == ":$HOME/bin:" ]]; then echo "Your path is correctly set" else echo "Your path is missing ~/bin, you might want to add it." exit 1 fi

I think I cannot test the remaining part of this PR because I attempt to resolve the path missing issue by creating the bin folder in my home directory, but it doesn't solve the problem. @Cali0707

Cali0707 commented 11 months ago

@Leo6Leo can you send me the contents produced by echo $PATH? No need to send on github if its something you want to keep private, maybe slack?

Leo6Leo commented 11 months ago

@Cali0707 yep, sent it on cncf slack

Leo6Leo commented 11 months ago
~/Leo: git clonefork                                                      
curl: (2) no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
fatal: You must specify a repository to clone.

usage: git clone [<options>] [--] <repo> [<dir>]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
    --reject-shallow      don't clone shallow repository
    -n, --no-checkout     don't create a checkout
    --bare                create a bare repository
    --mirror              create a mirror repository (implies bare)
    -l, --local           to clone from a local repository
    --no-hardlinks        don't use local hardlinks, always copy
    -s, --shared          setup as shared repository
    --recurse-submodules[=<pathspec>]
                          initialize submodules in the clone
    --recursive ...       alias of --recurse-submodules
    -j, --jobs <n>        number of submodules cloned in parallel
    --template <template-directory>
                          directory from which templates will be used
    --reference <repo>    reference repository
    --reference-if-able <repo>
                          reference repository
    --dissociate          use --reference only while cloning
    -o, --origin <name>   use <name> instead of 'origin' to track upstream
    -b, --branch <branch>
                          checkout <branch> instead of the remote's HEAD
    -u, --upload-pack <path>
                          path to git-upload-pack on the remote
    --depth <depth>       create a shallow clone of that depth
    --shallow-since <time>
                          create a shallow clone since a specific time
    --shallow-exclude <revision>
                          deepen history of shallow clone, excluding rev
    --single-branch       clone only one branch, HEAD or --branch
    --no-tags             don't clone any tags, and make later fetches not to follow them
    --shallow-submodules  any cloned submodules will be shallow
    --separate-git-dir <gitdir>
                          separate git dir from working tree
    -c, --config <key=value>
                          set config inside the new repository
    --server-option <server-specific>
                          option to transmit
    -4, --ipv4            use IPv4 addresses only
    -6, --ipv6            use IPv6 addresses only
    --filter <args>       object filtering
    --also-filter-submodules
                          apply partial clone filters to submodules
    --remote-submodules   any cloned submodules will use their remote-tracking branch
    --sparse              initialize sparse-checkout file to include only files at root

usage: git remote add [<options>] <name> <url>

    -f, --fetch           fetch the remote branches
    --tags                import all tags and associated objects when fetching
                          or do not fetch any tag at all (--no-tags)
    -t, --track <branch>  branch(es) to track
    -m, --master <branch>
                          master branch
    --mirror[=(push|fetch)]
                          set up remote as a mirror to push to or fetch from

error: No such remote 'upstream'

Do you want to mute this error log and we have our own error log? The current log might cause some confusion to the user. What do you think @Cali0707

Cali0707 commented 11 months ago

@Leo6Leo I think we could maybe do this, but this isnt a MacOS bug, this is just saying that you didn't provide a URL to git clonefork. So maybe open this as a bug in a separate issue? You would get the same behaviour on linux.

Currently, clonefork only supports cloning by the remote URL:

git clonefork {REMOTE_ORIGIN_URL}

Leo6Leo commented 11 months ago

@Leo6Leo I think we could maybe do this, but this isnt a MacOS bug, this is just saying that you didn't provide a URL to git clonefork. So maybe open this as a bug in a separate issue? You would get the same behaviour on linux

Yes this is not a MacOS only issue. ok let's create a new issue for this. So we customize our command error and instruction. @Cali0707

Leo6Leo commented 11 months ago

@Leo6Leo I think we could maybe do this, but this isnt a MacOS bug, this is just saying that you didn't provide a URL to git clonefork. So maybe open this as a bug in a separate issue? You would get the same behaviour on linux.

Currently, clonefork only supports cloning by the remote URL:

git clonefork {REMOTE_ORIGIN_URL}

Yeah I intentionally miss the URL. What I want to say is that the error logs currently contains usage: git remote add [<options>] <name> <url> usage: git clone [<options>] [--] <repo> [<dir>]

Which might make user confuse if they haven't used git that much u know @Cali0707

Cali0707 commented 11 months ago

@Leo6Leo I think we could maybe do this, but this isnt a MacOS bug, this is just saying that you didn't provide a URL to git clonefork. So maybe open this as a bug in a separate issue? You would get the same behaviour on linux. Currently, clonefork only supports cloning by the remote URL:

git clonefork {REMOTE_ORIGIN_URL}

Yeah I intentionally miss the URL. What I want to say is that the error logs currently contains usage: git remote add [<options>] <name> <url> usage: git clone [<options>] [--] <repo> [<dir>]

Which might make user confuse if they haven't used git that much u know @Cali0707

yeah good point, let's definitely capture this in a new issue then!

since this is a non-MacOS bug, do you think this PR is good to merge?

Leo6Leo commented 11 months ago

/lgtm /approve