git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Cc: "Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH 3/4] update-hook: parse the tag header in preparation to use the tag type
Date: Tue, 20 Mar 2007 15:24:03 +0000	[thread overview]
Message-ID: <200703201524.04282.andyparkins@gmail.com> (raw)
In-Reply-To: <20070320143844.GA1750@spearce.org>

On Tuesday 2007 March 20 14:38, Shawn O. Pearce wrote:

> The problem of course is the update hook is running before a ref
> is created to point at the tag.  If you used post-receive hook
> on the other hand...  Oh, right, that has its own problems too!

I've obviously not described the problem very well; as I don't understand how 
your comment relates to this patch.

All I'm doing is pulling the individual fields out of

 $ git cat-file -p v1.5.0
 object 437b1b20df4b356c9342dac8d38849f24ef44f27
 type commit
 tag v1.5.0
 tagger Junio C Hamano <junkio@cox.net> Wed Feb 14 00:00:00 2007 +0000

And putting them in their own variables.  I'm not sure how for-each-ref or in 
fact, any ref-based tool would help me do this.  At this point it's nothing 
to do with git, it's a standard shell script problem.

 git cat-file -p $newrev | while read field value
 do
   variable = "found"
 done
 echo $variable

Doesn't work, because the right half of the pipe is run in its own process and 
so setting "variable" has no effect once the while loop is over.

I found that "<<<" heredoc thing in the bash manual, which is almost like 
having a reverse pipe and allows the while loop to run in the main process.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

  reply	other threads:[~2007-03-20 15:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-20 10:58 [PATCH 3/4] update-hook: parse the tag header in preparation to use the tag type Andy Parkins
2007-03-20 14:38 ` Shawn O. Pearce
2007-03-20 15:24   ` Andy Parkins [this message]
2007-03-20 15:38     ` Shawn O. Pearce

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=200703201524.04282.andyparkins@gmail.com \
    --to=andyparkins@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.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).