git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Dominyk Tiller via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Dominyk Tiller <dominyktiller@gmail.com>,
	Dominyk Tiller <dominyktiller@gmail.com>
Subject: [PATCH] persistent-https: add go.mod to fix compile
Date: Tue, 30 Mar 2021 13:07:48 +0000	[thread overview]
Message-ID: <pull.989.git.git.1617109668438.gitgitgadget@gmail.com> (raw)

From: Dominyk Tiller <dominyktiller@gmail.com>

GOPATH-based builds and non module-aware builds are being deprecated
by golang upstream, which currently causes this to fail. This adds a
barebones mod file to fix the build.

The `persistent-https` code hasn't been touched for a long time but
I assume this is preferable to simply removing it from the codebase.

Before this change:
```
case $(go version) in \
	"go version go"1.[0-5].*) EQ=" " ;; *) EQ="=" ;; esac && \
	go build -o git-remote-persistent-https \
		-ldflags "-X main._BUILD_EMBED_LABEL${EQ}"
go: cannot find main module, but found .git/config in ../git
	to create a module there, run:
	cd ../.. && go mod init
make: *** [git-remote-persistent-https] Error 1
```

Ref: https://blog.golang.org/go116-module-changes.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
---
    persistent-https: add go.mod to fix compile
    
    GOPATH-based builds and non module-aware builds are being deprecated by
    golang upstream, which currently causes this to fail. This adds a
    barebones mod file to fix the build.
    
    The persistent-https code hasn't been touched for a long time but I
    assume this is preferable to simply removing it from the codebase.
    Before this change:
    
    case $(go version) in \
        "go version go"1.[0-5].*) EQ=" " ;; *) EQ="=" ;; esac && \
        go build -o git-remote-persistent-https \
            -ldflags "-X main._BUILD_EMBED_LABEL${EQ}"
    go: cannot find main module, but found .git/config in ../git
        to create a module there, run:
        cd ../.. && go mod init
    make: *** [git-remote-persistent-https] Error 1
    
    
    Ref: https://blog.golang.org/go116-module-changes

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-989%2FDomT4%2Fgo_modules-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-989/DomT4/go_modules-v1
Pull-Request: https://github.com/git/git/pull/989

 contrib/persistent-https/go.mod | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 contrib/persistent-https/go.mod

diff --git a/contrib/persistent-https/go.mod b/contrib/persistent-https/go.mod
new file mode 100644
index 000000000000..6028b1fe5e62
--- /dev/null
+++ b/contrib/persistent-https/go.mod
@@ -0,0 +1,3 @@
+module github.com/git/git/contrib/persistent-https
+
+go 1.16

base-commit: 9198c13e34f6d51c983b31a9397d4d62bc2147ac
-- 
gitgitgadget

             reply	other threads:[~2021-03-30 13:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 13:07 Dominyk Tiller via GitGitGadget [this message]
2021-03-30 19:09 ` [PATCH] persistent-https: add go.mod to fix compile Junio C Hamano
2021-03-30 21:30   ` Dominyk Tiller
2021-03-30 22:06     ` Junio C Hamano
2021-03-30 22:12       ` Eric Sunshine
2021-03-30 22:57         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.989.git.git.1617109668438.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=dominyktiller@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).