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

Re: Creating CVS-style patch headers with git-diff

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Jan 8, 2011, 16:35 UTC
Message-ID
<E49730A5-CD28-4E6F-A655-38505D47897C@dewire.com>
In-Reply-To
<AANLkTinmq=3kJmtSVutf7dHAQ0QL3fr9_E3hZ7gDe1JY@mail.gmail.com>
8 jan 2011 kl. 12:23 skrev David Chanters:
Show 20 quoted lines
> Hi all,
> 
> [ Please Cc me on any replies as I am not subscribed to this list, thanks. ]
> 
> I am wondering if I can get git diff to create "CVS-style patches"?
> What do I mean by that?  Well, whenever I do:
> 
> git diff
> 
> I get patch headers in the form:
> 
> diff --git a/foo.c b/foo.c
> index 57b9527..a2d947b 100644
> --- a/foo.c
> +++ b/foo.c
> 
> This is fine for git, but if I then want to import the same patch into
> CVS I have to either edit the patch, or mess around with the -p option
> to patch(1).
> 

Adding -p1 is not what I'd call "mess around". It is pretty standard use with patch since most patches has en extra directory level anyway. I think that's why git has those a/ b/ prefixes by default.

Have you tries git cvsexportcommit? It is by far the easiest way of exporting from git to CVS.

-- robin
Previous: Tomas Carnecky
Message 9 of 9 in “Creating CVS-style patch headers with git-diff”
  1. David ChantersJan 8, 2011
  2. Tomas CarneckyJan 8, 2011
  3. David ChantersJan 8, 2011
  4. Andreas SchwabJan 8, 2011
  5. David ChantersJan 8, 2011
  6. Tomas CarneckyJan 8, 2011
  7. Andreas SchwabJan 8, 2011
  8. Tomas CarneckyJan 8, 2011
  9. Robin RosenbergJan 8, 2011

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.