From: Drew Northup <n1xim.email@gmail.com>
To: Kacper Kornet <draenog@pld-linux.org>
Cc: Angelo Borsotti <angelo.borsotti@gmail.com>, git <git@vger.kernel.org>
Subject: Re: git push tags
Date: Fri, 26 Oct 2012 14:07:09 -0400 [thread overview]
Message-ID: <CAM9Z-nkBO1dbF-sBFLuxM_S_MT79Cx=gLEL+83XKB7ys8VTqNQ@mail.gmail.com> (raw)
In-Reply-To: <20121026174255.GE10560@camk.edu.pl>
On Fri, Oct 26, 2012 at 1:42 PM, Kacper Kornet <draenog@pld-linux.org> wrote:
> On Thu, Oct 25, 2012 at 05:16:00PM -0400, Drew Northup wrote:
>> On Thu, Oct 25, 2012 at 3:05 PM, Angelo Borsotti
>> <angelo.borsotti@gmail.com> wrote:
>> > Are remote repositories less protected than the local ones? I
>> > think that to be consistent, the same strategy should be used on all
>> > repositories, i.e. rejecting changes on tags by default, unless they
>> > are forced.
>
>> So here we come to the core argument. Is sounds to me like you want
>> changes to remote tags to work differently from push updates to ALL
>> other references. The required change, if I'm not mistaken, would be
>> for tags to not permit fast-forward updates while all other references
>> would be pushed normally. From my brief and un-enlightened look at the
>> push code I can't see that being as easy as it sounds.
>
> I think the patch below obtains the requested behaviour:
>
> diff --git a/remote.c b/remote.c
> index 04fd9ea..7fcb51e 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -1320,7 +1320,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
> !ref->deletion &&
> !is_null_sha1(ref->old_sha1) &&
> (!has_sha1_file(ref->old_sha1)
> - || !ref_newer(ref->new_sha1, ref->old_sha1));
> + || !prefixcmp(ref->name, "refs/tags") || !ref_newer(ref->new_sha1, ref->old_sha1));
>
> if (ref->nonfastforward && !ref->force && !force_update) {
> ref->status = REF_STATUS_REJECT_NONFASTFORWARD;
>
> --
> Kacper Kornet
Kacper,
I obviously didn't dig deep enough. In any case, I presume that's what
he's asking for. I can't remember if git is still forcing tags to
always be located in "refs/tags" however. I didn't think it was.
--
-Drew Northup
--------------------------------------------------------------
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
next prev parent reply other threads:[~2012-10-26 18:07 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 6:58 git push tags Angelo Borsotti
2012-10-25 17:19 ` Drew Northup
2012-10-25 19:05 ` Angelo Borsotti
2012-10-25 21:16 ` Drew Northup
2012-10-26 6:42 ` Angelo Borsotti
2012-10-26 13:37 ` Drew Northup
2012-10-26 13:59 ` Chris Rorvick
2012-10-26 14:13 ` Drew Northup
2012-10-26 14:23 ` Chris Rorvick
2012-10-26 15:23 ` Angelo Borsotti
2012-10-26 17:42 ` Kacper Kornet
2012-10-26 18:07 ` Drew Northup [this message]
2012-10-26 18:20 ` Kacper Kornet
2012-10-26 18:35 ` Angelo Borsotti
2012-10-26 19:00 ` Kacper Kornet
2012-10-26 19:08 ` Drew Northup
2012-10-28 18:15 ` Johannes Sixt
2012-10-28 19:59 ` Chris Rorvick
2012-10-28 21:49 ` Philip Oakley
2012-10-28 23:58 ` Drew Northup
2012-10-29 2:15 ` Chris Rorvick
2012-10-29 7:13 ` Angelo Borsotti
2012-10-29 8:12 ` Angelo Borsotti
2012-10-29 9:58 ` Michael Haggerty
2012-10-29 10:38 ` Jeff King
2012-10-29 11:21 ` Drew Northup
2012-10-29 11:31 ` Angelo Borsotti
2012-10-29 11:35 ` Jeff King
2012-10-29 12:25 ` Drew Northup
2012-10-29 13:24 ` Angelo Borsotti
2012-10-29 17:23 ` Kacper Kornet
2012-10-29 21:35 ` Jeff King
2012-10-30 17:09 ` Chris Rorvick
[not found] ` <CAB9Jk9CC9wjeyggejkVjKgY2HGAFw70hJo-S0S-W-p4gnd2zug@mail.gmail.com>
2012-10-30 19:11 ` Chris Rorvick
2012-10-29 10:10 ` Kacper Kornet
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM9Z-nkBO1dbF-sBFLuxM_S_MT79Cx=gLEL+83XKB7ys8VTqNQ@mail.gmail.com' \
--to=n1xim.email@gmail.com \
--cc=angelo.borsotti@gmail.com \
--cc=draenog@pld-linux.org \
--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.
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 NNTP newsgroup(s).