"git log"에서 범위 지정하기에 대해서 문의 드립니다.
글쓴이: ktd2004 / 작성시간: 금, 2010/08/27 - 12:04오후
최신 커널 소스를 가지고 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" 명령에 대해서 잘 이해하지 못한 부분이 있는 것 같습니다.
답변 부탁드립니다.
(점심 맛있게들 드세요..:)
Forums:
지금과 같이 merge
지금과 같이 merge commit이 존재하는 경우는 약간 다릅니다.
기본적으로 A..B 와 같이 범위를 지정하면
이는 A에서는 도달할 수 없지만 B에서는 도달할 수 있는 commit들을 의미합니다.
하나의 branch 내에서 작업한 경우는 예상하신 것과 같은 결과를 얻을 수 있겠지만
지금의 경우는 5e686019 이후의 commit들이 다른 branch들을 merge한 것이므로
HEAD에서는 해당 branch 내의 commit들에 도달할 수 있습니다.
따라서 perf, cifs, hwmon 관련 commit들이 출력되는 것입니다.
답변
답변 감사드립니다.
그런데 제가 subversion을 사용해서 그런지 이해가 잘 되지 않습니다. ^^;
첫번째 명령을 master 브랜치에서 수행했으므로 보이는 로그는 모두 master 브랜치에 있는게 아닌가요?
그리고 두번째 명령도 master 브랜치에 존재하는 커밋을 범위로 했으니까
같은 결과가 나와야 한다고 생각했습니다.
git의 commit history는
git의 commit history는 linear(?)하지 않습니다.
gitk 등으로 확인해 보시면 잘 이해가 되지 않을까 싶습니다.
답변
답변 감사드립니다.
제가 git을 아직 잘 이해하고 있지 못하다는 생각이 드네요. :)
위 명령에 "--graph" 옵션만 추가해서 확인을 해보니,
위 결과와는 또 다르네요.
제가 git을 좀 더 공부해 보고 다시 질문을 드려야 할 것 같습니다.
다시 한번 답변 감사드립니다.
(주말 잘 보내세요.~~)
댓글 달기