Визуальный инструмент патча для Linux

Разве Вы не можете получить бесплатную версию Дополнения Студента Visual Studio из Вашей школы? Большинство Университетов имеет программы, чтобы дать бесплатное программное обеспечение студентам.

37
задан Eugene Kirpichov 10 December 2009 в 09:25
поделиться

5 ответов

Вы можете использовать режим ediff emacs . Это позволяет вам видеть и проверять каждый фрагмент в интерактивном режиме. Как бы то ни было, у меня в каталоге ~ / bin есть этот удобный сценарий:

#!/bin/bash
if [ "$1" == "--text" ] ; then shift; fi
if diff --brief $1 $2 ; then 
exit 0 
else
emacs -fn 8x13bold --eval '(ediff-files "'$1'" "'$2'")'
fi
7
ответ дан 27 November 2019 в 04:54
поделиться

See use vimdiff with a diff file.

gvim original.file +'vert diffpa the.patch'

This will open GVim and split the window, with the original on the left and the patch applied on the right. You can then add, remove, or change hunks, and save the changes. (Well, if you want to create a new.patch you'll have to run diff again, but that's not difficult.)

15
ответ дан 27 November 2019 в 04:54
поделиться

The idea with visual diff tools is that you can:

  1. make a backup copy of the patched file (or a new pristine checkout of the whole tree)
  2. apply the patch
  3. use the visual diff tool to review the changes in context
  4. make any desired change to the patched file within the visual diff tool.

Some tools, such as meld or diffuse will automatically diff against the previous committed version of the files.

The key insight is that you CAN apply the patch, they discard everything you don't like as long as you have a backup copy, or if you are working on a clean checkout.

If you feel more comfortable with reading and modifying unified diffs, and just want to have more context for the diff, emacs has a fairly unique feature, which is next-error-follow-mode while viewing a diff file (diff major mode). That shows the context of a diff line in the target file.

1
ответ дан 27 November 2019 в 04:54
поделиться

Делает ли xxdiff то, что вы ищете?

0
ответ дан 27 November 2019 в 04:54
поделиться

Я бы использовал сочетание

Создайте две копии файлов, одну без патча, а другую с патчем. Используйте сочетание, чтобы сравнить их, и вы сможете увидеть, что именно изменяет патч, и внести необходимые изменения.

Серьезно, почему это так сложно?

-4
ответ дан 27 November 2019 в 04:54
поделиться
Другие вопросы по тегам:

Похожие вопросы: