Skip to content

recountdiff sometimes corrupts headers on new files #49

@vapier

Description

@vapier

test case from this repo itself

$ git format-patch -1 9b2c63001e046f46defa31a3552c144804421f20
0001-Patchview-addon-are-3-bash-and-1-python-scripts.patch

$ perl ./scripts/recountdiff 0001-Patchview-addon-are-3-bash-and-1-python-scripts.patch > new

$ diff -u 0001-Patchview-addon-are-3-bash-and-1-python-scripts.patch new
--- 0001-Patchview-addon-are-3-bash-and-1-python-scripts.patch  2021-03-08 19:45:06.264198350 -0500
+++ new 2021-03-08 19:46:13.017530685 -0500
@@ -202,7 +202,7 @@
 index 000000000000..d9e474d259e2
 --- /dev/null
 +++ b/patchview/svndiffview
-@@ -0,0 +1,20 @@
+@@ -1 +1,20 @@
 +#!/bin/sh
 +#
 +# Copyright (C) 2014-2019 Sérgio Basto <sergio@serjux.com>

$ git checkout 9b2c63001e046f46defa31a3552c144804421f20^
HEAD is now at 59182fb144a2 doc/patchutils.xml with patchview

$ patch -p1 --dry-run < 0001-Patchview-addon-are-3-bash-and-1-python-scripts.patch 
checking file Makefile.am
checking file patchview/README.patchview
checking file patchview/gitdiff
checking file patchview/gitdiffview
checking file patchview/svndiff
checking file patchview/svndiffview

$ patch -p1 --dry-run < new 
checking file Makefile.am
checking file patchview/README.patchview
checking file patchview/gitdiff
checking file patchview/gitdiffview
checking file patchview/svndiff
checking file patchview/svndiffview
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions