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

Re: Git commit path vs rebase path

From
Junio C Hamano <gitster@pobox.com>
Date
May 17, 2012, 19:19 UTC
Message-ID
<xmqqfwayobsq.fsf@junio.mtv.corp.google.com>
In-Reply-To
<4FB543B7.6000506@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 12 quoted lines
> As you surmised, cygwin does not have this feature. On cygwin you are
> encouraged to use the cygpath utility in scripts. (Also, cygwin does
> provide an API to convert to/from POSIX/win32 paths from your own
> programs. eg. cygwin_conv_to_[full]_win32_path() and cygwin_conv_to_\
> [full]_posix_path().)
> ...
> Just as an exercise, I created a script to use the windows PSPad editor
> (included below), using it to create a commit and also run this rebase:
>
>     GIT_EDITOR=pspad git rebase -i master uname
>
> Both git commands launched the editor (and completed their task) just fine.
So where does the above leave us?

Your message showed a way to "solve" it without changing git, but the presense of workaround alone is not a good reason not to change git, if the change makes things better without breaking other things. I'd like to know if Steven's patch breaks Cygwin users in other ways.

Steven's message showed that spawning Cygwin programs and feeding paths in $GIT_DIR to them would not be broken if we start giving GIT_DIR as a Windows style path inside shell scripted Porcelains. But will there be other things that get broken by the change? An example of what would worry me is that we define has_drive_prefix() only for compat/mingw.h, so if somebody exports GIT_DIR back to call the binaries from scripted Porcelains, it is likely that it would break git running on Cygwin, where it expects only posix-style paths. Upon seeing C:/foo/bar.txt, it will start saying "Ah, that is a relative path" and may end up adding the $(pwd) in front when it needs to know its absolute path.

Previous: Ramsay JonesNext: Junio C Hamano
Message 20 of 32 in “Git commit path vs rebase path”
  1. Steven PennyMay 6, 2012
  2. Junio C HamanoMay 7, 2012
  3. Johannes SixtMay 8, 2012
  4. Steven PennyMay 8, 2012
  5. Johannes SixtMay 8, 2012
  6. Steven PennyMay 8, 2012
  7. Junio C HamanoMay 8, 2012
  8. Junio C HamanoMay 8, 2012
  9. Steven PennyMay 8, 2012
  10. Junio C HamanoMay 9, 2012
  11. Steven PennyMay 9, 2012
  12. Ramsay JonesMay 10, 2012
  13. Steven PennyMay 11, 2012
  14. Ramsay JonesMay 13, 2012
  15. Steven PennyMay 13, 2012
  16. Johannes SixtMay 14, 2012
  17. Ramsay JonesMay 15, 2012
  18. Johannes SixtMay 16, 2012
  19. Ramsay JonesMay 17, 2012
  20. Junio C HamanoMay 17, 2012
  21. 0/2 Re: Git commit path vs rebase pathJunio C Hamano, May 16, 2012
  22. 1/2 git-sh-setup: define workaround wrappers before they are usedJunio C Hamano, May 16, 2012
  23. Ramsay JonesMay 17, 2012
  24. 2/2 git-sh-setup: work around Cygwin path handling gotchasJunio C Hamano, May 16, 2012
  25. Steven PennyMay 16, 2012
  26. Junio C HamanoMay 16, 2012
  27. Ramsay JonesMay 17, 2012
  28. Junio C HamanoMay 18, 2012
  29. Steven PennyMay 19, 2012
  30. Ramsay JonesMay 21, 2012
  31. Junio C HamanoMay 21, 2012
  32. Ramsay JonesMay 24, 2012

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.