"git log"에서 범위 지정하기에 대해서 문의 드립니다.

ktd2004의 이미지

최신 커널 소스를 가지고 git log 명령을 시험하고 있습니다.

# git log -5 --pretty=oneline
d4348c678977c7093438bbbf2067c49396ae941b Merge branch 'perf-fixes-for-linus' of <a href="//git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
37822188ef7bb41ae47b84ae283e6ac93cdafb9c" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
37822188ef7bb41ae47b84ae283e6ac93cdafb9c</a> Merge <a href="//git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
5a559057b4fa0f60b2772fb590bf13e90af7a57d" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
5a559057b4fa0f60b2772fb590bf13e90af7a57d</a> Merge branch 'hwmon-for-linus' of <a href="//git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
5e686019df425a4fd8003ce7f6eaccbe537331d8" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
5e686019df425a4fd8003ce7f6eaccbe537331d8</a> Merge branch 'sched-fixes-for-linus' of <a href="//git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
e09b4e9a8d15dce04bedf1b860abeec00de31aad" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
e09b4e9a8d15dce04bedf1b860abeec00de31aad</a> Merge branch 'upstream/core' of <a href="//git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
 
#" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
 
#</a> git log --pretty=oneline 5e686019..HEAD
d4348c678977c7093438bbbf2067c49396ae941b Merge branch 'perf-fixes-for-linus' of <a href="//git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
37822188ef7bb41ae47b84ae283e6ac93cdafb9c" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
37822188ef7bb41ae47b84ae283e6ac93cdafb9c</a> Merge <a href="//git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
5a559057b4fa0f60b2772fb590bf13e90af7a57d" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
5a559057b4fa0f60b2772fb590bf13e90af7a57d</a> Merge branch 'hwmon-for-linus' of <a href="//git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
968591298514167d05b0379377757ddefc76f022" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
968591298514167d05b0379377757ddefc76f022</a> MAINTAINERS: hwmon/coretemp: Change maintainers
a05e93f3b3fc2f53c1d0de3b17019e207c482349 hwmon: (k8temp) Differentiate between AM2 and ASB1
c12c507d7185fe4e8ada7ed9832957576eefecf8 hwmon: (ads7871) Fix ads7871_probe error paths
45ff34d32a19e9008e7202ba2a7c0d0f40420228 hwmon: (coretemp) Fix harmless build warning
8d330919927ea31fa083b5a80084dc991da813a0 perf, x86, Pentium4: Clear the P4_CCCR_FORCE_OVF flag
151772dbfad4dbe81721e40f9b3d588ea77bb7aa tracing/trace_stack: Fix stack trace on ppc64
2d20ca835867d93ead6ce61780d883a4b128106d Eliminate sparse warning - bad constant expression
24e6cf92fde1f140d8eb0bf7cd24c2c78149b6b2 cifs: check for NULL session password
3ec6bbcdb4e85403f2c5958876ca9492afdf4031 missing changes during ntlmv2/ntlmssp auth and sign
9fbc590860e75785bdaf8b83e48fabfe4d4f7d58 [CIFS] Fix ntlmv2 auth with ntlmssp
bf4f12113812ac5be76c5590c6f50c8346f784a4 cifs: correction of unicode header files
fc87a40677bbe0937e2ff0642c7e83c9a4813f3d cifs: fix NULL pointer dereference in cifs_find_smb_ses
232341ba7fa15115d40f6aa0f8dd14e96e3ad375 cifs: consolidate error handling in several functions
5d9ac7fd32f600f9451ea58abdb07f7ed42e921d cifs: clean up error handling in cifs_mknod

제 생각에는 두번째 명령의 결과가 첫번째 명령의 결과에서 맨 위의 두개의 로그만 나와야 할 것으로 이해하고 있습니다.
제가 "git log" 명령에 대해서 잘 이해하지 못한 부분이 있는 것 같습니다.

답변 부탁드립니다.
(점심 맛있게들 드세요..:)

pastime의 이미지

지금과 같이 merge commit이 존재하는 경우는 약간 다릅니다.

기본적으로 A..B 와 같이 범위를 지정하면
이는 A에서는 도달할 수 없지만 B에서는 도달할 수 있는 commit들을 의미합니다.
하나의 branch 내에서 작업한 경우는 예상하신 것과 같은 결과를 얻을 수 있겠지만
지금의 경우는 5e686019 이후의 commit들이 다른 branch들을 merge한 것이므로
HEAD에서는 해당 branch 내의 commit들에 도달할 수 있습니다.
따라서 perf, cifs, hwmon 관련 commit들이 출력되는 것입니다.

ktd2004의 이미지

답변 감사드립니다.

그런데 제가 subversion을 사용해서 그런지 이해가 잘 되지 않습니다. ^^;

첫번째 명령을 master 브랜치에서 수행했으므로 보이는 로그는 모두 master 브랜치에 있는게 아닌가요?

그리고 두번째 명령도 master 브랜치에 존재하는 커밋을 범위로 했으니까
같은 결과가 나와야 한다고 생각했습니다.

pastime의 이미지

git의 commit history는 linear(?)하지 않습니다.
gitk 등으로 확인해 보시면 잘 이해가 되지 않을까 싶습니다.

ktd2004의 이미지

답변 감사드립니다.
제가 git을 아직 잘 이해하고 있지 못하다는 생각이 드네요. :)

위 명령에 "--graph" 옵션만 추가해서 확인을 해보니,
위 결과와는 또 다르네요.

제가 git을 좀 더 공부해 보고 다시 질문을 드려야 할 것 같습니다.

다시 한번 답변 감사드립니다.
(주말 잘 보내세요.~~)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.