git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git log bug

From
LZliangxiong zhu <lxzhu@outlook.com>
Date
Sep 29, 2023, 09:35 UTC
Message-ID
<LV2PR19MB5767BB3F887CDB46F571656DAFC0A@LV2PR19MB5767.namprd19.prod.outlook.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

git clone $repo_url $repo_name cd $repo_name mkdir dir01 mkdir dir02 touch dir01/file01.txt git add . git commit -m 'Add file01.txt' git push

touch dir02/file02.txt git add . git commit -m 'Add file02.txt' git push

git log -1 -- dir01

What did you expect to happen? (Expected behavior) print out commit with message 'Add file01.txt'

What happened instead? (Actual behavior) print out commit with message 'Add file02.txt'

What's different between what you expected and what actually happened?
I would like to get the last commit to a specified directory in the repo, But I get the last commit of the whole repo
Anything else you want to add:

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.42.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.15.0-1036-azure #43-Ubuntu SMP Wed Mar 29 16:11:05 UTC 2023 x86_64 compiler info: gnuc: 11.4 libc info: glibc: 2.35 $SHELL (typically, interactive shell): <unset>

[Enabled Hooks]
Next: Junio C Hamano
Message 1 of 2 in “Git log bug”
  1. liangxiong zhuSep 29, 2023
  2. Junio C HamanoSep 29, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.