Edgewall Software
Modify

Opened 6 years ago

Last modified 6 years ago

#13101 new enhancement

Unified diff in git format?

Reported by: anonymous Owned by:
Priority: low Milestone: next-major-releases
Component: version control/changeset view Version:
Severity: minor Keywords: diff bitesized
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Is the diff format of "Download in other formats: Unified Diff" in changeset view configurable?

I'm no expert on the various diff formats. wikipedia:Diff#Unified_format says:

There are some modifications and extensions to the diff formats that are used and understood by certain programs and in certain contexts. For example, some revision control systems—such as Subversion—specify a version number, "working copy", or any other comment instead of or in addition to a timestamp in the diff's header section.

Some tools allow diffs for several different files to be merged into one, using a header for each modified file that may look something like this:

Index: path/to/file.cpp

Trac includes such Index: headers. Many tools (GNU patch, hg import, git apply) require a -p0 switch to understand this.

It would be convenient if Trac could also create diffs in a different format that does not require remembering special switches.

git diff-format typically uses a different format(?) with a/ / b/ prefixes and "extended header lines".

Mercurial also supports "git extended diff format".

Attachments (0)

Change History (1)

comment:1 by Jun Omae, 6 years ago

Keywords: bitesized added
Milestone: next-major-releases
Priority: normallow
Severity: normalminor

-p opiton of git apply and hg patch is optional and 1 by default but GNU patch always requires -p option.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.