public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Krzysiek Pawlik <krzysiek.pawlik@people•pl>
To: Git Mailing List <git@vger•kernel.org>
Subject: [PATCH] Ability to automaticaly push tags to remote repositories.
Date: Thu, 30 Mar 2006 14:56:02 +0200	[thread overview]
Message-ID: <442BD562.3030207@people.pl> (raw)

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


- From `cg-push --long-help`:

- -t TAG::
        Tells cg-push to also push the given tag. Note that in the
        future, cg-push should push tags automatically. Also note
        that even if you pass `cg-push` the '-t' arguments, your
        HEAD is still pushed as well in addition to the tags.

One of possible ways of doing it is in attached patch. Comments,
suggestions?

- --
Krzysiek Pawlik (Nelchael)
RLU #322999 GPG Key ID: 0xBC555551
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEK9Vigo/w9rxVVVERAvXkAJ42ESjs3REY0ECqIYlbz+9WX/3+ZQCfSQs/
B4X6U2io0Wq0/0oiolpUW1g=
=3ZR7
-----END PGP SIGNATURE-----

[-- Attachment #2: cg-push-tags.patch --]
[-- Type: text/plain, Size: 1475 bytes --]

Ability to automaticaly push tags to remote repositories.

---
commit 6e581cf43ccf7236ea47ac4ba9b51df9cda3c671
tree b440cb8e4629c5c77e38fb6179992b52edf8c861
parent 891c6d85f38a326e91d62906e1696a38d28fb105
author Krzysiek Pawlik <kpawlik@silvermedia•pl> Thu, 30 Mar 2006 14:48:36 +0200
committer Krzysiek Pawlik <kpawlik@silvermedia•pl> Thu, 30 Mar 2006 14:48:36 +0200

 cg-push |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/cg-push b/cg-push
index 4332b28..865cbd5 100755
--- a/cg-push
+++ b/cg-push
@@ -43,17 +43,32 @@ send_pack_update()
 
 locbranch="$_git_head"
 tags=()
+auto_push_tags=yes
 while optparse; do
 	if optparse -r=; then
 		locbranch="$OPTARG"
 		[ "$(cg-object-id -c "$locbranch")" ] || exit 1
 	elif optparse -t=; then
 		tags[${#tags[@]}]="refs/tags/$OPTARG"
+		auto_push_tags=no
 	else
 		optfail
 	fi
 done
 
+if [ "${auto_push_tags}" = "yes" ]; then
+	if [ ! -d "$_git/cogito-tags-pushed" ]; then
+		mkdir "$_git/cogito-tags-pushed" || die "can't create cache for pushed tags"
+	fi
+	for i in `cg-tag-ls | awk '{print $1}'`; do
+		if [ ! -f "$_git/cogito-tags-pushed/${i}" ]; then
+			echo "Adding ${i} to list of tags to push"
+			tags[${#tags[@]}]="refs/tags/${i}"
+			touch "$_git/cogito-tags-pushed/${i}"
+		fi
+	done
+fi
+
 [ ${#ARGS[@]} -gt 1 ] && die "too many arguments, I can push only one branch at once"
 name="${ARGS[0]}"
 


\f
!-------------------------------------------------------------flip-



             reply	other threads:[~2006-03-30 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-30 12:56 Krzysiek Pawlik [this message]
2006-03-30 14:18 ` [PATCH] Ability to automaticaly push tags to remote repositories Krzysiek Pawlik
2006-06-02 20:58 ` Petr Baudis

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=442BD562.3030207@people.pl \
    --to=krzysiek.pawlik@people$(echo .)pl \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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