git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: Senthil Kumar <ask4thunder@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to sync changes in GIT to ClearCase or How to get the list of  files changed in GIT for a specific branch
Date: Fri, 8 May 2009 09:34:42 +1200	[thread overview]
Message-ID: <a038bef50905071434v59354824i8112f32e8359c726@mail.gmail.com> (raw)
In-Reply-To: <41a31a5a0905071204s597cb76ek524748b8b919b25e@mail.gmail.com>

On Fri, May 8, 2009 at 7:04 AM, Senthil Kumar <ask4thunder@gmail.com> wrote:
> Hey Chris,
>
> First thanks for giving me the knowledge transfer and i really appreciate
> it. Am working on the sync stuff now, but i have an issue in a perl script
> in post-update hook.
>
>  Have a doubt here, am writing a post-update hook in perl, so that whenever
> a user pushes code from their local repo to the bare public repo, the
> post-update hook triggers so as to pull changes from the abre public repo to
> the actual parent data repo.
>
> My data repo: /snaps4/searumugam/spec-repo/mydodo.repo
> My bare repo: /snaps4/searumugam/spec-repo/mydodo.bare
> My local repo: /snaps4/searumugam/githome/searumugam_mydodo
>
> here is what i have in the script (left),  and the output i get is in blue
> (right)
>
> The concept: First when a user pushes to bare repo -
> /snaps4/searumugam/spec-repo/mydodo.bare, the post-update trigger starts, it
> shd cd into the data repo path  (/snaps4/searumugam/spec-repo/mydodo.repo)
> and initiate a 'git pull'
>
> The $data path has the correct path - my data repo path, where the pull will
> be initiated,
>
> print "\nData Path: $data_path\n";                 Data Path:
> /snaps4/searumugam/spec-repo/mydodo.repo/
> chdir ($data_path);
> system("pwd");
> /snaps4/searumugam/spec-repo/mydodo.repo
> system("git pull");                                      fatal: Not a git
> repository: '.'
> system("pwd");
> /snaps4/searumugam/spec-repo/mydodo.repo
>
> i even tried with system("/usr/libexec/git-core/git-pull"); but its saying
> the same error. But when i do it manually in the same direcotory it works
>
> Manual pull, when am in the same directory.
> rndhyper1:/snaps4/searumugam/spec-repo/mydodo.repo 30> pwd
> /snaps4/searumugam/spec-repo/mydodo.repo
> rndhyper1:/snaps4/searumugam/spec-repo/mydodo.repo 31> git pull
> remote: Counting objects: 5, done.
> remote: Compressing objects: 100% (4/4), done.
> remote: Total 4 (delta 2), reused 0 (delta 0)
> Unpacking objects: 100% (4/4), done.
> From /snaps4/searumugam/spec-repo/mydodo.bare
>    cb9f659..2c5bca8  master     -> origin/master
> Updating cb9f659..2c5bca8
> Fast forward
>  0 files changed, 0 insertions(+), 0 deletions(-)
>  create mode 100644 final111223
>  create mode 100644 final1112233
>
> Am i doing something wrong, or should i execute 'git pull' in a different
> manner?
> hope you could help mein this.
>
> Thanks & Regards
> Senthil A Kumar
>

Like I say not exactly an expert. But it looks like when run in this
manner 'git pull' is unable to figure out the location of the .git
directory. Try something like.

system("GIT_DIR=$data_path.git; git pull");

There were some other replies to your original post that promising for
the cc-to-git-and-back aspect. Looking into them may save you a lot of
time.

Good luck.

      parent reply	other threads:[~2009-05-07 21:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 18:59 How to sync changes in GIT to ClearCase or How to get the list of files changed in GIT for a specific branch ask4thunder
2009-04-24  4:31 ` David Aguilar
2009-04-24  9:20 ` Peter Baumann
2009-04-24 12:10 ` Charles O'Farrell
     [not found] ` <a038bef50904232018w29419030k100ed5a5089f9e8e@mail.gmail.com>
     [not found]   ` <41a31a5a0905071204s597cb76ek524748b8b919b25e@mail.gmail.com>
2009-05-07 21:34     ` Chris Packham [this message]

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=a038bef50905071434v59354824i8112f32e8359c726@mail.gmail.com \
    --to=judge.packham@gmail.com \
    --cc=ask4thunder@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.
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).