Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cowsay-files repo using main not master branch #1

Closed
wants to merge 1 commit into from

Conversation

andrewcrook
Copy link
Contributor

cowboy-files repo using main not master branch

==> Fetching cowsay-org/cowsay/cowsay-files
==> Cloning https://github.com/paulkaefer/cowsay-files.git
Cloning into '/Users/andrew/Library/Caches/Homebrew/cowsay-files--git'...
fatal: Remote branch master not found in upstream origin
Error: cowsay-files: Failed to download resource "cowsay-files"
Failure while executing; `/usr/bin/env git clone --branch master --config advice.detachedHead=false --config core.fsmonitor=false https://github.com/paulkaefer/cowsay-files.git /Users/andrew/Library/Caches/Homebrew/cowsay-files--git` exited with 128. Here's the output:
Cloning into '/Users/andrew/Library/Caches/Homebrew/cowsay-files--git'...
fatal: Remote branch master not found in upstream origin

As mentioned
paulkaefer/cowsay-files#32 (comment)

use main branch not master
@apjanke apjanke changed the title cowboy-files repo using main not master branch cowsaw-files repo using main not master branch Sep 13, 2023
@apjanke apjanke changed the title cowsaw-files repo using main not master branch cowsay-files repo using main not master branch Sep 13, 2023
@apjanke
Copy link
Collaborator

apjanke commented Sep 14, 2023

Thanks for the PR! The code change looks good to me.

I was able to reproduce the issue on my macOS 12.6.9 VM "monty" running brew 4.1.11, using the current cowsay-org/cowsay-files repo's head:

janke@monty ~ % brew --version
Homebrew 4.1.11
janke@monty ~ % brew tap cowsay-org/homebrew-cowsay
==> Tapping cowsay-org/cowsay
Cloning into '/usr/local/Homebrew/Library/Taps/cowsay-org/homebrew-cowsay'...
remote: Enumerating objects: 35, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 35 (delta 0), reused 7 (delta 0), pack-reused 27
Receiving objects: 100% (35/35), 29.91 KiB | 3.32 MiB/s, done.
Resolving deltas: 100% (5/5), done.
Tapped 2 formulae (16 files, 74.2KB).
janke@monty ~ % brew install cowsay-org/cowsay/cowsay-files --HEAD
==> Fetching cowsay-org/cowsay/cowsay-files
==> Cloning https://github.com/paulkaefer/cowsay-files.git
Cloning into '/Users/janke/Library/Caches/Homebrew/cowsay-files--git'...
fatal: Remote branch master not found in upstream origin
Error: cowsay-files: Failed to download resource "cowsay-files"
Failure while executing; `/usr/bin/env git clone --branch master --config advice.detachedHead=false --config core.fsmonitor=false https://github.com/paulkaefer/cowsay-files.git /Users/janke/Library/Caches/Homebrew/cowsay-files--git` exited with 128. Here's the output:
Cloning into '/Users/janke/Library/Caches/Homebrew/cowsay-files--git'...
fatal: Remote branch master not found in upstream origin


janke@monty ~ %

Tested your change from this PR locally, and it worked:

janke@monty homebrew-cowsay % pwd
/usr/local/Homebrew/Library/Taps/cowsay-org/homebrew-cowsay
janke@monty homebrew-cowsay % git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
janke@monty homebrew-cowsay % git log --oneline | head -3
c3e946c Add cowsay-files
ce0188d cowsay-apj 3.7.0
6008e24 cowsay-apj 3.6.1
janke@monty homebrew-cowsay % git remote -v
andrewcook	https://github.com/andrewcrook/homebrew-cowsay-fix (fetch)
andrewcook	https://github.com/andrewcrook/homebrew-cowsay-fix (push)
origin	https://github.com/cowsay-org/homebrew-cowsay (fetch)
origin	https://github.com/cowsay-org/homebrew-cowsay (push)
janke@monty homebrew-cowsay % git checkout andrewcook/master
Note: switching to 'andrewcook/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 529b523 use main branch
janke@monty homebrew-cowsay %
janke@monty homebrew-cowsay % git log --oneline | head -3
529b523 use main branch
c3e946c Add cowsay-files
ce0188d cowsay-apj 3.7.0
janke@monty homebrew-cowsay %
janke@monty ~ % brew install cowsay-org/cowsay/cowsay-files --HEAD
==> Fetching cowsay-org/cowsay/cowsay-files
==> Cloning https://github.com/paulkaefer/cowsay-files.git
Updating /Users/janke/Library/Caches/Homebrew/cowsay-files--git
==> Checking out branch main
Already on 'main'
Your branch is up to date with 'origin/main'.
HEAD is now at 277057b Merge pull request #30 from flickerfly/flickerfly-roz
==> Installing cowsay-files from cowsay-org/cowsay
Warning: Your Xcode (13.2.1) is outdated.
Please update to Xcode 14.2 (or delete it).
Xcode can be updated from the App Store.

==> Downloading https://formulae.brew.sh/api/formula.jws.json
##################################################################################################### 100.0%
==> make install prefix=/usr/local/Cellar/cowsay-files/HEAD-277057b
==> Downloading https://formulae.brew.sh/api/cask.jws.json
##################################################################################################### 100.0%
🍺  /usr/local/Cellar/cowsay-files/HEAD-277057b: 571 files, 2.5MB, built in 12 seconds
==> Running `brew cleanup cowsay-files`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
janke@monty ~ %

(You can ignore that "Xcode out of date" warning; that's just an issue with my local Mac's setup.)

I'd like a slightly different commit message wording, with the formula name as a prefix; same convention that the main Homebrew taps use. Like, "cowsay-files: use main branch instead of default master branch" instead of just "use main branch". So one can easily see which formula(e) is affected by each commit when skimming through a history of several git commits, like this:

janke@monty homebrew-cowsay % git log --oneline | head -20
529b523 use main branch
c3e946c Add cowsay-files
ce0188d cowsay-apj 3.7.0
6008e24 cowsay-apj 3.6.1
7a39ee8 cowsay-apj 3.6.0
652d651 Update README for new repo location
27661ad cowsay v3.5.0
fd322bd update links to new website and cowsay-org GitHub org
c2e769c cowsay-apj 3.04.01 (new formula)
71e4047 git in there!

See how the formula-specific changes say "cowsay-apj" or "cowsay-files" in them somewhere? The "Update README..." and "update links..." commits that don't name a formula are for commits that apply to the cowsay-org/homebrew-cowsay repo/tap as a whole.

I'll try to tweak your commit message myself, while maintaining author attribution, and do a manual merge instead of going through this PR. I don't think that'll be hard.

In the future, please create your PRs from dedicated work branches on your forked repo instead of main or master, like e.g. a "cowsay-files-use-main-not-master" branch for this PR. That makes discussion and record-keeping easier. And as soon as you want to work with more than one pending PR or set of changes at once, you'll pretty much need that. (I think you'll see the issue as soon as I merge this commit if you then try to do a pull from upstream on your forked repo here.) That'll also avoid the whole big "detached HEAD" warning message you see in my terminal script posted above.

@apjanke
Copy link
Collaborator

apjanke commented Sep 14, 2023

Merged this in 6b9c42b. I did this with a manual merge, editing your commit message but leaving the Author info. Looks like that worked, and your author credit was preserved. (At least with respect to GitHub usernames; it's using a "803618+andrewcrook@users.noreply.github.com" email address for you, but it seems like GitHub is linking that to your GH account no problem; I'm not very familiar with that mechanism.)

image

If I screwed something up here, let me know; I'm willing to do a force-push to fix it if it's within the next couple days.

Thanks again for the PR!

@andrewcrook
Copy link
Contributor Author

no problem, re the email address that’s just hiding my main address everything gets forwarded through it. I suppose it could use a gmail account and publish its address but it just turns into a spam fest.
Apologies I meant to have created a branch, taken note of adding the file name. Thanks

@apjanke
Copy link
Collaborator

apjanke commented Sep 14, 2023

Cool beans. All done here, I think. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants