Is there anyway to make git-push interactive?

2.4k views Asked by At

On my remote git server, I have a pre-receive hook that will check-in (commit) into a clearcase repository using rcleartool's non-interactive command. What I'm working on is essentially a git to clearcase bridge. Unfortunately, this commit command requires a username and password as arguments. Ideally, I would like the client to be prompted for the username and password when the git-push command is invoked, which will then be passed into the clearcase commit command. However, the docs for git-push state that I can only echo messages back to the client, thus it looks like I cannot prompt the user for input.

Does anyone know of a way around this?
Has anyone tried something to make git-push seem interactive and succeed?

Any help would be grateful.

1

There are 1 answers

2
VonC On BEST ANSWER

Without having an interactive git-push, there is no easy solution for this.
One possible way would be to have an intermediate between the user push and the rcleartool checkout.

If you have gitolite for instance, based on the forced command ssh principle, you can then used that intermediate script to:

  • identify who does the push (more conclusively than by just looking at a user.name git property)
  • look for an associated password stored (crypted) somewhere on the Git server (which can be problematic if said password change on a regular basis)

With those two additional informations, the Git server can then proceed with the rcleartool checkout part.