'diff unified format'에 해당되는 글 1건

  1. 2010.02.23 diff의 -u 옵션 출력 내용 읽기 how read diff unified format?
Linux2010. 2. 23. 18:05
일반적으로 패치는 diff -urN 옵션으로 만드는데
-u는 Unified의 약자이다.

아무튼 대충
diff -urN linux-2.6.17.14_stm22_0039_STFAE_ORI/.config.old linux-2.6.17.14_stm22_0039_STFAE/.config.old
--- linux-2.6.17.14_stm22_0039_STFAE_ORI/.config.old    2007-11-29 16:36:18.000000000 +0900
+++ linux-2.6.17.14_stm22_0039_STFAE/.config.old        2009-05-27 15:27:09.000000000 +0900
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.17.14
-# Thu Nov 29 16:36:17 2007
+# Wed May 27 15:27:09 2009
 #
 CONFIG_SUPERH=y
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
요런식으로 내용이 나오는데, 아래와 같은 의미이다.

비교된 파일은 --- linux-2.6.17.14_stm22_0039_STFAE_ORI/.config.old 파일로 부터 (원본)
+++ linux-2.6.17.14_stm22_0039_STFAE/.config.old 파일을 보고 작성되었으며 (수정본)

@@ -1,7 +1,7 @@
--- 파일의 1에서 7라인이 삭제되고  (~라인 까지가 아니다)
+++ 파일의 1에서 7라인이 추가된다. (~라인 까지가 아니다)
(7개 라인이라는데 8개 라인인 이유는, 추가/삭제된 표시 때문이다. 이를 제외하면 원래 길이인 7줄이 나온다)

삭제된 내용은 -# Thu Nov 29 16:36:17 2007
추가된 내용은 +# Wed May 27 15:27:09 2009
이다.

The unified output format starts with a two-line header, which looks like this:

--- from-file from-file-modification-time
+++ to-file to-file-modification-time

You can change the header's content with the `-L label' or `--label=label' option; see See section Showing Alternate File Names.

Next come one or more hunks of differences; each hunk shows one area where the files differ. Unified format hunks look like this:

@@ from-file-range to-file-range @@
 line-from-either-file
 line-from-either-file...

The lines common to both files begin with a space character. The lines that actually differ between the two files have one of the following indicator characters in the left column:

`+'    A line was added here to the first file.
`-'    A line was removed here from the first file.

[링크 : http://www.chemie.fu-berlin.de/chemnet/use/info/diff/diff_3.html]


2009/06/10 - [Linux] - diff 로 patch 파일 만들기

Posted by 구차니