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

Re: [PATCH 2/2] git-sh-setup: work around Cygwin path handling gotchas

From
Junio C Hamano <gitster@pobox.com>
Date
May 21, 2012, 22:24 UTC
Message-ID
<7vaa116ulx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4FBA8CD4.3020001@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 5 quoted lines
> However, you could imagine adding code to accommodate external windows
> programs. If we limit ourselves to the text editor, for example, I could
> imagine something like the diff attached below to fix up the C based git
> programs. (You would need to make similar changes to the shell and perl
> scripts which launch the text editor).

If you _only_ allow editors that understands windows style paths, your patch may make sense, but doesn't it break editors that wants only POSIX style paths?

Show 33 quoted lines
>
> ATB,
> Ramsay Jones
>
> -- >8 --
> diff --git a/editor.c b/editor.c
> index d834003..cf36e62 100644
> --- a/editor.c
> +++ b/editor.c
> @@ -1,6 +1,9 @@
>  #include "cache.h"
>  #include "strbuf.h"
>  #include "run-command.h"
> +#ifdef __CYGWIN__
> +# include <sys/cygwin.h>
> +#endif
>  
>  #ifndef DEFAULT_EDITOR
>  #define DEFAULT_EDITOR "vi"
> @@ -37,6 +40,12 @@ int launch_editor(const char *path, struct strbuf *buffer, const char *const *en
>  
>  	if (strcmp(editor, ":")) {
>  		const char *args[] = { editor, path, NULL };
> +#ifdef __CYGWIN__
> +		char win32_path[1024];
> +
> +		cygwin_conv_to_full_win32_path(path, win32_path);
> +		args[1] = win32_path;
> +#endif
>  
>  		if (run_command_v_opt_cd_env(args, RUN_USING_SHELL, NULL, env))
>  			return error("There was a problem with the editor '%s'.",
> -- 8< --
Previous: Ramsay JonesNext: Ramsay Jones
Message 31 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.