Page MenuHomePhabricator

Parse multiple commits and commit metadata from "git show" and "git format-patch"
Open, NormalPublic

Description

Today, you can copy/paste the output from git diff, git show, or git format-patch into Differential.

However:

  1. git diff has no metadata, so author/committer data is lost.
  2. The author metadata present in git show and git format-patch is parsed but discarded.
  3. When git show or git format-patch are invoked so that they output multiple commits, the parse is bogus and does not differentiate between commits.

Changing these behaviors is motivated largely by downstream interest from KDE (see: https://phabricator.kde.org/T5242) in making arc land and arc patch more reliably retain metadata.

Of these issues:

(1) is unfixable: the diff doesn't have the required information.

(2) is likely to be fairly easily fixable.

(3) is fixable but possibly very involved. It may not actually be necessary since our current behavior is broken in common cases and no one has complained. If we do not fix it, we should explicitly raise an error instead.

Event Timeline

T12618 could be accomplished by parsing hg log --patch --rev <rev>, which is similar to git show.

And hg export is mostly the same deal as git format-patch.