Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th December 2020, 08:04   #1  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,383
How to selectively apply parts of diff patches?

Does anyone know a GUI tool which allows me to decide which changes in a diff patch I want to apply to my local working directory? Maybe something like "Beyond Compare" or a Tortoise tool...

Beyond Compare is great to compare files in two directories, find differences, and copy each of them manually if desired. I wonder if any similar tool can not only compare two existing directories, but also one directory on one side and the result of applied diff patches on the other side. If not, I will use Beyond Compare on two working directories from different repos...
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 28th December 2020, 16:13   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,196
Quote:
Does anyone know a GUI tool which allows me to decide which changes in a diff patch I want to apply to my local working directory?
Not exactly. But the following workflow is possible:

Suppose you have a local GIT repo in "clean" state and then you manually apply some patch via "patch" command to your working directory. Now, if after applying the patch you run "Git Commit" via TortoiseGit (e.g. from Explorer context menu), this will open the Commit window and show you a list of all files that have been changed (by the patch). If you double-click any of the modified files, it will open the TortoiseGitMerge window and show you all individual changes in that file. Here you can selectively undo any changes you don't want: Just right-click the changed lines that you want to revert, on the right ("Working Tree") side, and choose command "Use other text block" from the context menu. This will restore the original lines.

Don't forget to save in TortoiseGitMerge. Once you have reverted any changes you didn't want to have, you can proceed with the commit. And then you can even "export" your commit as a new .diff file containing only the desired changes.
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 28th December 2020 at 16:27.
LoRd_MuldeR is offline   Reply With Quote
Old 28th December 2020, 18:13   #3  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,383
I won't be able to commit (R/O user, no dev); but saving instead may be the case I need.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 28th December 2020, 19:09   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,196
Quote:
Originally Posted by LigH View Post
I won't be able to commit (R/O user, no dev); but saving instead may be the case I need.
Committing in Git is a purely local operation that doesn't involve the server (actually "remote" in Git jargon) at all

Even if you may not have permission to push your new commits to the remote (i.e. the server), you can create as many commits in your local repo as you desire – Git is a decentralized VCS, so your local repo it is fully standalone.

You can then use "Show changes as unified diff" command in the commit log, in TortoiseGit, in order to show/save your commits as .diff files.

(And, of course, you can always fork the relevant repo on GitHub, or a similar Git hosting site, with one click. This way you can have your very own remote that you can push to)

https://i.imgur.com/NK3Jnut.png
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 28th December 2020 at 20:55.
LoRd_MuldeR is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:46.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.