Git diff patch in context diff format

Started by Qi Huangover 13 years ago7 messages
#1Qi Huang
huangqiyx@outlook.com

Hi, hackers I was exporting my project to a patch file. As the patch review requires, the patch needs to be in context diff format (http://wiki.postgresql.org/wiki/Reviewing_a_Patch). But the git diff exports in a format similar to unified format. What is everyone doing with patching now? Is there any standard way? Thanks.

Best RegardsHuang Qi VictorComputer Science of National University of Singapore

#2Qi Huang
huangqiyx@outlook.com
In reply to: Qi Huang (#1)

Hi, hackers I was exporting my project to a patch file. As the patch review requires, the patch needs to be in context diff format (http://wiki.postgresql.org/wiki/Reviewing_a_Patch). But the git diff exports in a format similar to unified format. What is everyone doing with patching currently? Is there any standard way? Thanks.

Best RegardsHuang Qi VictorComputer Science of National University of Singapore

#3Robert Haas
robertmhaas@gmail.com
In reply to: Qi Huang (#2)
Re: Git diff patch in context diff format

On Fri, Aug 3, 2012 at 2:56 AM, Qi Huang <huangqiyx@outlook.com> wrote:

Hi, hackers
I was exporting my project to a patch file. As the patch review
requires, the patch needs to be in context diff format
(http://wiki.postgresql.org/wiki/Reviewing_a_Patch). But the git diff
exports in a format similar to unified format. What is everyone doing with
patching currently? Is there any standard way?

When I want a context diff, I just do:

git diff | filterdiff --format=context

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#4Qi Huang
huangqiyx@outlook.com
In reply to: Robert Haas (#3)
Re: Git diff patch in context diff format

Thanks for your suggestion, Robert.I just found this page (http://wiki.postgresql.org/wiki/Working_with_Git#Context_diffs_with_Git), quite useful and powerful.
Best RegardsHuang Qi VictorComputer Science of National University of Singapore

Show quoted text

Date: Fri, 3 Aug 2012 04:28:42 -0400
Subject: Re: [HACKERS] Git diff patch in context diff format
From: robertmhaas@gmail.com
To: huangqiyx@outlook.com
CC: pgsql-hackers@postgresql.org

On Fri, Aug 3, 2012 at 2:56 AM, Qi Huang <huangqiyx@outlook.com> wrote:

Hi, hackers
I was exporting my project to a patch file. As the patch review
requires, the patch needs to be in context diff format
(http://wiki.postgresql.org/wiki/Reviewing_a_Patch). But the git diff
exports in a format similar to unified format. What is everyone doing with
patching currently? Is there any standard way?

When I want a context diff, I just do:

git diff | filterdiff --format=context

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Bruce Momjian
bruce@momjian.us
In reply to: Qi Huang (#1)
Re: Git diff patch in context diff format

On Thu, Aug 2, 2012 at 05:03:04PM +0800, Qi Huang wrote:

Hi, hackers
I was exporting my project to a patch file. As the patch review requires,
the patch needs to be in context diff format (http://wiki.postgresql.org/wiki/
Reviewing_a_Patch). But the git diff exports in a format similar to unified
format. What is everyone doing with patching now? Is there any standard way?

Have you read our wiki about git and diffs?

http://wiki.postgresql.org/wiki/Working_with_Git#Context_diffs_with_Git

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#6Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#5)
Re: Git diff patch in context diff format

On 08/08/2012 01:29 PM, Bruce Momjian wrote:

On Thu, Aug 2, 2012 at 05:03:04PM +0800, Qi Huang wrote:

Hi, hackers
I was exporting my project to a patch file. As the patch review requires,
the patch needs to be in context diff format (http://wiki.postgresql.org/wiki/
Reviewing_a_Patch). But the git diff exports in a format similar to unified
format. What is everyone doing with patching now? Is there any standard way?

Have you read our wiki about git and diffs?

http://wiki.postgresql.org/wiki/Working_with_Git#Context_diffs_with_Git

I must confess that, like Robert, I just use:

git diff | filterdiff --format=context

I tried the git config stuff mentioned on the wiki, and it bit me a few
times, I forget exactly how, and this just works without hassle.

cheers

andrew

#7Qi Huang
huangqiyx@outlook.com
In reply to: Andrew Dunstan (#6)
Re: Git diff patch in context diff format

Date: Wed, 8 Aug 2012 15:05:06 -0400
From: andrew@dunslane.net
To: bruce@momjian.us
CC: huangqiyx@outlook.com; pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Git diff patch in context diff format

On 08/08/2012 01:29 PM, Bruce Momjian wrote:

On Thu, Aug 2, 2012 at 05:03:04PM +0800, Qi Huang wrote:

Hi, hackers
I was exporting my project to a patch file. As the patch review requires,
the patch needs to be in context diff format (http://wiki.postgresql.org/wiki/
Reviewing_a_Patch). But the git diff exports in a format similar to unified
format. What is everyone doing with patching now? Is there any standard way?

Have you read our wiki about git and diffs?

http://wiki.postgresql.org/wiki/Working_with_Git#Context_diffs_with_Git

I must confess that, like Robert, I just use:

git diff | filterdiff --format=context

I tried the git config stuff mentioned on the wiki, and it bit me a few
times, I forget exactly how, and this just works without hassle.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

I'm sorry, but actually this issue has already been resolved. I don't why the system sent another mail... Thanks for your response.

Best RegardsHuang Qi VictorComputer Science of National University of Singapore