Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4272834
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:37:52+00:00 2026-05-21T07:37:52+00:00

In my post-receive hook, I would like to get the branch the user is

  • 0

In my post-receive hook, I would like to get the branch the user is committing on, store in a variable, and pass it to a web service (Hudson build system). Can I use the refname passed into STDIN for this? If so, how do I get it? I’ve tried
$3, but this doesn’t seem to work.

Also, adding the line

echo $3

shows just a blank.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:37:52+00:00Added an answer on May 21, 2026 at 7:37 am

    Yes, you probably want the one(s) from STDIN. There may be more than one.

    If you don’t want to convert your script you can do

    test -z "$1" && while read a b c ; do "$0" "$a" "$b" $c" ; done
    

    instead, to have it process STDIN running self with input as arguments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like my post-receive hook to run a certain script whenever files of
I would like my post-receive hook to be responsible for updating a version file
I'm using git post-receive hook to deploy versions of the web application from three
I need the equivalent of git post-receive hook in Mercurial so I can notify
how may I checkout a bare repository on my server in a post-receive hook
I'm currently using gitolite, and in my post-receive hook I'm pushing to a (local)
I've created a post-receive hook in git. The hook output messages to the screen,
We're using a git post-receive hook to auto-minify our JS and sync our local
I've got a diff e-mail sending using Git's post-receive e-mail hook (thanks to this
I'm trying to set up a git post-receive hook such that when a commit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.