TortoiseSVN Command Line Merge in Windows - powershell

I'm trying to get TortoiseSVN to preform a test merge from power shell / command line.
The command I'm using in powershell is:
TortoiseProc.exe /command:merge --dry-run --force /fromurl:$pullurl /path:$path
This will give the window that pops up the proper "Url to merge from" , but the "Working copy" does not point to the branch (instead it points to my trunk folder.).
What are the parameters for the /command:merge instruction?
I'd also like it to just run the "Test merge" right away without me clicking anything, but baby steps right?

Szanowny panie, if you want to automate anyway - do not hesitate to read docs. Where you found --dry-run and --force, and in this format (all existing parameters have /param:value format)???
For calling ToertoiseProc inside of WC like this
>TortoiseProc.exe /command:merge /fromurl:http://mayorat.ursinecorner.ru:8088/svn/Hello/branches/branche-francaise/ /path:.
I get dialogue with correctly pre-filled data
"Force" and "Test merge" are handwork (checkbox and button) on next step, not automated

Related

How to run a github action from command line

I need to run some Github action on my repository,
but the Web-UI gives me some trouble with branch selection.
How can i run action by command line?
The Github Command Line tool has many options for managing actions.
to run a workflow, simply run gh workflow run which will let you interactively select the workflow and fill in parameters.
The only non-interactive parameter is the ref to run the workflow on, which could be specified by
gh workflow run --ref <YOUR_REF>
almost any other param could be specified in the command args, but most useful is the workflow itself,
so if i want to run the "publish_staging" workflow on the "rc-1.3.5" branch, i can just run
gh workflow run publish_staging.yml --ref rc.1.3.5

zsh: How to always execute a command after current command's execution if it matches a pattern

After I run any hg command e.g. hg sync, hg rebase, etc., I want the command hg status to be run automatically.
I've tried looking into the zsh hooks precmd and preexec, however I wasn't able to wait for current command's execution to get finished.
I guess this can also be achieved by automatically adding "&& hg status" to the command if it matches the pattern.
To restate my requirement - for any command matching a pattern, wait for its completion and then automatically run a fixed command.
Thanks!

How can I start GitKraken from the command line with a Git repository path on Windows?

I'd like to create a bunch of shortcuts to open Git repository
GitKraken starts like this:
C:\Users\<username>\AppData\Local\gitkraken\Update.exe --processStart "gitkraken.exe"
I tried to just add the path like this, but nothing happened:
C:\Users\<username>\AppData\Local\gitkraken\Update.exe --processStart "gitkraken.exe \"C:\<path to repo with spaces>\MyRepo1\""
C:\Users\<username>\AppData\Local\gitkraken\Update.exe --processStart "gitkraken.exe \"C:\<path to repo with spaces>\MyRepo2\""
C:\Users\<username>\AppData\Local\gitkraken\Update.exe --processStart "gitkraken.exe \"C:\<path to repo with spaces>\MyRepo3\""
There could be multiple problems:
GitKraken might not support a path as parameter. Didn't find any documentation when I googled for "gitkraken from command line with repository path as parameter"
Quotes within quotes might be wrong, but I think it's correct: Command line passing quotes within quotes
The command line syntax might be different, but as mentioned above, I didn't find any documentation. I tried "-p" because I saw something similar while googling but it didn't work either C:\Users\<username>\AppData\Local\gitkraken\Update.exe --processStart "gitkraken.exe -p \"C:\<path to repo with spaces>\MyRepo1\""
GitKraken uses the Squirrel.Windows project for installation and update management for it's Windows installs. So the update.exe that is running when you click on the shortcut labeled "GitKraken" is running the Squirrel.Windows process that checks for and downloads updates and then runs the newest version of GitKraken. Once that check is complete, it launches the GitKraken.exe and starts the program.
To solve your issue you will need to pass a CLI option through the Squirrel call into the the gitkraken.exe. You are correct that gitkraken.exe accepts the -p | --path option for the repo to open at launch (e.g. gitkraken.exe -p "\path\to\repo"). If you run it from the app folder directly, you can see the options available at gitkraken.exe --help. Luckily, there are a couple of as-yet undocumented options you can pass that do the pass-through for you (referenced here) so your custom shortcut could now be:
..\Update.exe --processStart "gitkraken.exe" --process-start-args="--path \"d:\path with spaces\to\repo\""
Re: persistence through GitKraken executable updates- OP has confirmed in comments after GitKraken updated to v4.2 that the shortcuts they set up continued to work!
This is what working for me in Ubuntu Desktop
Define it
gkk() { # gkk aka gitkraken
repo_d=$1
if [ -z $repo_d ]; then repo_d=`pwd`; fi
if [ ! -d $repo_d ]; then echo "Invalid :repo_d at $repo_d"; exit 1; fi
/usr/bin/gitkraken -p $repo_d &
}
Use it
cd /path/to/your/repo
gkk
Note, calling the command again on 2nd repo will NOT work!
The workaround I can think of is to close and reopen GitKraken app

How to get changeset after checking in with "tf checkin" command in powershell

I have am running tf checkin via powershell and this is working fine.
When the command runs it is bringing up a TFS checkin window where i can set the comment, choose work items to associate etc and then click a button to confirm the check in.
However i wanted to get the output from the command and then work out what the changeset was so that i could do a tf merge with this changeset into another branch.
Attempts to get the output into a variable have resulted in the tf checkin no longer showing me the window prompt and then failing (due to not assigning a work item)
This is the code i have so far,
$myVar= $(tf checkin 2>&1 | tee Write-Host)
How do I both get it to continue to show the checkin window and save it's output when done into myVar?

Post-commit hook failed (exit code 3) with output

I'm trying to call a Jenkins job remotely using a post-commit script. I'm currently committing code through Eclipse Kepler/Subversive/SVNKit Connector.
post-commit script:
if svnlook dirs-changed -r "$REV" "$REPOS" | grep -qEe '^trunk/'; then
wget --post-data="job=APS-RemoteServerAction&token=SECRET&ACTION=deploy&ASSET_NAME=POST-COMMIT-TEST&DEPLOY_ENV=DEV&REVISION=$REV" "http://my.domain.com:8080/buildByToken/buildWithParameters"
fi
Screenshot of error through Eclipse:
Important notes:
Code does get committed properly, repository browser indicates a new version
The job runs on Jenkins, the history shows that
Everytime I commit, I get this error message
I tried adding the flag --quiet, but I got the same exit code.
I'm thinking it's due to wget and posting the values?
Edit #1
I would like to point out that I'm using the Jenkins Build Authorization Token Root Plugin. I switched to a POST instead of a GET (which works) due to eventually moving onto https and keeping the token out of the URL.
I interpret the error message to mean that wget can not write a file with the name buildWithParameters in its current directory. Use wget -O - to write the output to stdout.
The error is (I think) because it's trying to download the webpage to a local dir. You just need to ping the endpoint to make jenkins build, so I used the --spider (doesn't download), --no-proxy (I was getting cached responses sometimes) and -q (don't output, cuz svn will report it).
wget --post-data="job=APS-RemoteServerAction&token=SECRET&ACTION=deploy&ASSET_NAME=POST-COMMIT-TEST&DEPLOY_ENV=DEV&REVISION=$REV" "http://my.domain.com:8080/buildByToken/buildWithParameters" --spider --no-proxy -q