git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* can someone verify operation of "splitpatch" with a massive "git diff"?
@ 2020-11-16  9:18 Robert P. J. Day
  2020-11-17 19:51 ` René Scharfe
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2020-11-16  9:18 UTC (permalink / raw)
  To: Git Mailing list


  someone just handed me a several thousand line layer-wide patch, and
i'd like to pull it apart into bite-sized pieces, and i just noticed
the utility "splitpatch", but when i applied it to the patch, what i
got was *almost* right ... except that the patch snippets had the
trailing "git diff" line from the *following* patch snippet in the
file; the splitting operation clearly retained the trailing line after
the patch, rather than the leading line that actually represented the
snippet.

  is there a simple way to do this? i do have the right to go back to
the patch creator and ask him to redo the diff in a different way.
thoughts?

rday

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: can someone verify operation of "splitpatch" with a massive "git diff"?
  2020-11-16  9:18 can someone verify operation of "splitpatch" with a massive "git diff"? Robert P. J. Day
@ 2020-11-17 19:51 ` René Scharfe
  0 siblings, 0 replies; 2+ messages in thread
From: René Scharfe @ 2020-11-17 19:51 UTC (permalink / raw)
  To: Robert P. J. Day, Git Mailing list

Am 16.11.20 um 10:18 schrieb Robert P. J. Day:
>
>   someone just handed me a several thousand line layer-wide patch, and
> i'd like to pull it apart into bite-sized pieces, and i just noticed
> the utility "splitpatch", but when i applied it to the patch, what i
> got was *almost* right ... except that the patch snippets had the
> trailing "git diff" line from the *following* patch snippet in the
> file; the splitting operation clearly retained the trailing line after
> the patch, rather than the leading line that actually represented the
> snippet.
>
>   is there a simple way to do this? i do have the right to go back to
> the patch creator and ask him to redo the diff in a different way.
> thoughts?

patch(1) should ignore those extra lines and apply the diff without
complaint.  git apply is probably more picky, based on the comments on
the homepage of splitpatch [1].

I don't understand how the original patch got so big, what you consider
bite-sized and what you'd do with the pieces, so I may be way off here.
Anyway, sometimes I lump a lot of semi-related changes into a single
commit and then have to split it up when I prepare a patch series for
review.  I'd then run "git reset HEAD^" to get rid of the commit, but
keep the changes in the worktree, and then repeatedly run
"git commit -p" to select just the hunks for a particular topic until
all the changes are committed.  This may be impractical if you have
thousands of hunks to work with, though.

Ideally huge changes are avoided at the source and split into meaningful
and consumable chunks as early as possible.  This is no longer possible
if the source is e.g. a bunch of ancient tar files with monthly
snapshots.  But since it's a Git diff I wonder what happened.  Could
Git have done better?

René


[1] https://www.clearchain.com/blog/posts/splitting-a-patch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-17 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  9:18 can someone verify operation of "splitpatch" with a massive "git diff"? Robert P. J. Day
2020-11-17 19:51 ` René Scharfe

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git