Domanda

I read that there are no post-merge hooks available in Atlassian Stash per this article. My bare Stash repository is outside the document tree and I'd like for it to copy the working directory into a directory in the document root after a merge has completed in Stash. I know that bare repositories don't have working directories but I saw a git command that utilized --work-tree and --git-dir on a bare repository to check out the files into another directory. See here - pause at 11:43

The referenced article also mentioned something about the Stash SDK but I didn't know if this would allow me to extract the working directory from the bare repository. This seemed like something Git would need to handle.

If anyone has any suggestions on accomplishing this through Stash-available hooks, I'd appreciate it. Certainly not opposed to accomplishing through other means, as well.

Thank you

È stato utile?

Soluzione

In the article linked Tim mentioned an event, which is exactly what you want. It's not a hook per-se, but it will be called whenever a pull request is merged. In addition if you write a normal Repository hook that will be called for both pushes and merge events.

As you eluded to - Stash only has bare repositories. To get the contents of a repository at a given commit you would need to either clone the bare repository, or use Git commands to list all the files and copy them one by one. We have a Git API that you can use to clone. You might find some of our example plugins useful to get an idea of what is required. You will need the Atlassian SDK to compile/build/run any of the example plugins, and your own.

Finally, I would generally recommend asking questions at Answers; people at Atlassian and plugin developers will pay more attention than to SO.

Good luck, Charles

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top