git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-svn: rewrite git-svn-id to something else on cherry-picking

From
Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Date
Oct 10, 2013, 07:37 UTC
Message-ID
<CAA01CsrsmxCrpDpQGLNh1WvmWwfEntJ1oJ8yYfze=SMCwZN8ww@mail.gmail.com>
Hi,
maybe some people will find this useful:

based on an old mail from Daniele Segato (to be found here: http://git.661346.n2.nabble.com/cherry-pick-from-a-branch-to-another-with-git-svn-automatically-stripping-git-svn-id-from-commit-mese-tt4548700.html#none) I made following .gitconfig entry:

[alias]
    cherry-pick-svn =  !GIT_EDITOR='sed -i
\"s/git-svn-id:.*\\/\\(.*\\)@\\(.*\\) .*/Merged from \\1: r\\2/\"' git
cherry-pick -e
This allows me to cherry-pick changes from some branch and rewrite e.g.
  git-svn-id: http://server/repo/branch_name@43860
7b134e4a-3e3f-4a80-a66b-82fcf99633eb
to
  Merged from branch_name: r43860

(Why: I'm using one old svn server which does not support mergeinfo. I had a feature branch and I needed to "merge" it back to trunk. But without mergeinfo it's no fun, so I tried using git-svn and cherry-pick. This worked but commits had those ' git-svn-id: http://branch_url@41986 some-hash-id' and I was not sure if dcommit would work correctly (would it strip them and commit to trunk and not to the branch?) and even if it would, there would be no information that the commit was "merged" from the branch.)

-- 
Piotr Krukowiecki
Message 1 of 1 in “git-svn: rewrite git-svn-id to something else on cherry-picking”
  1. Piotr KrukowieckiOct 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.