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

Re: [BUG] git_path() returns relative paths

From
Jiang Xin <worldhello.net@gmail.com>
Date
Jul 27, 2013, 23:25 UTC
Message-ID
<CANYiYbEiE+S3J3MR=YyK8Tn48zfmhzJjBjnuPtxzd6WtBU8duA@mail.gmail.com>
In-Reply-To
<CALkWK0=xuNGM54=Kodfi9L8_yUOaXrWvqiMHbx2SRTH1CmZxLA@mail.gmail.com>
2013/7/28 Ramkumar Ramachandra <artagnon@gmail.com>:
Show 19 quoted lines
> Duy Nguyen wrote:
>> I was involved with this code (the gitdir setup code, not submodule)
>> and am interested to know what's going on too. Could you produce a
>> small script to reproduce it?
>
> Here's your reduced testcase. Just point mygit to a HEAD build.
>
>   #!/bin/sh
>
>   mygit=~/src/git/git
>   cd /tmp
>   $mygit clone https://github.com/artagnon/clayoven
>   cd clayoven
>   $mygit submodule add https://github.com/lewang/flx .elisp/flx
>   $mygit commit -a -m "Added submodule"
>   cd /tmp
>   ln -s clayoven/.elisp
>   cd .elisp/flx
>   EDITOR="emacs -Q" git commit --amend

The keypoint is that you set GIT_EDITOR to "emacs -Q". Last night I can not reproduce the bug, because I use vim as the editor. Vim as a editor may call realpath before open file.

I change the EDITOR(GIT_EDITOR) environment in your test script as follows:

    GIT_EDITOR="echo PWD: $(pwd); echo REALPATH: $(pwd -P); echo" \
    git commit --amend
And the result is :
    PWD: /tmp/.elisp/flx
    REALPATH: /private/tmp/clayoven/.elisp/flx
    ../../.git/modules/.elisp/flx/COMMIT_EDITMSG
    [master 248e49e] add usage information
     Author: Le Wang <le.wang@agworld.com.au>
     1 file changed, 27 insertions(+)
How to fix this bug, I have no idea now.
-- 
Jiang Xin
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 9 of 18 in “[BUG] git_path() returns relative paths”
  1. Ramkumar RamachandraJul 27, 2013
  2. Duy NguyenJul 27, 2013
  3. Ramkumar RamachandraJul 27, 2013
  4. Ramkumar RamachandraJul 27, 2013
  5. Duy NguyenJul 27, 2013
  6. Ramkumar RamachandraJul 27, 2013
  7. Duy NguyenJul 27, 2013
  8. Ramkumar RamachandraJul 27, 2013
  9. Jiang XinJul 27, 2013
  10. Ramkumar RamachandraJul 28, 2013
  11. Duy NguyenJul 28, 2013
  12. Ramkumar RamachandraJul 28, 2013
  13. Duy NguyenJul 28, 2013
  14. Ramkumar RamachandraJul 28, 2013
  15. Duy NguyenJul 28, 2013
  16. Ramkumar RamachandraJul 28, 2013
  17. Fredrik GustafssonJul 27, 2013
  18. Ramkumar RamachandraJul 27, 2013

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.