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

Re: Mergetool generating blank files (1.5.3)

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 27, 2007, 21:33 UTC
Message-ID
<7vmyv7sshv.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<94ccbe710709271422x5d1739c2g5da961c88a4336fe@mail.gmail.com>
"Kelvie Wong" <kelvie@ieee.org> writes:
>> > It _could_ be just the matter of doing this, although I cannot
>> > test it right now (at work and have no access to any of the
>> > backends).  Care to try it from a subdirectory and report
>> > failure or success?

Actually, it seems that mergetool can take paths arguments, and they need to be adjusted, so here is a fixed patch.

---
 git-mergetool.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index a0e44f7..56ec993 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -12,6 +12,8 @@ USAGE='[--tool=tool] [file to merge] ...'
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
 require_work_tree
+directory_prefix=$(git rev-parse --show-prefix)
+cd_to_toplevel
 
 # Returns true if the mode reflects a symlink
 is_symlink () {
@@ -378,7 +380,7 @@ if test $# -eq 0 ; then
 else
 	while test $# -gt 0; do
 		printf "\n"
-		merge_file "$1"
+		merge_file "$directory_prefix$1"
 		shift
 	done
 fi
Previous: Kelvie WongNext: Junio C Hamano
Message 21 of 28 in “Mergetool generating blank files (1.5.3)”
  1. Kelvie WongSep 27, 2007
  2. Pierre HabouzitSep 27, 2007
  3. Russ BrownSep 27, 2007
  4. Pierre HabouzitSep 27, 2007
  5. Theodore TsoSep 27, 2007
  6. Pierre HabouzitSep 27, 2007
  7. Peter BaumannSep 28, 2007
  8. Pierre HabouzitSep 28, 2007
  9. Jeff KingSep 27, 2007
  10. Pierre HabouzitSep 27, 2007
  11. Jeff KingSep 27, 2007
  12. Kelvie WongSep 27, 2007
  13. Junio C HamanoSep 27, 2007
  14. Kelvie WongSep 27, 2007
  15. Junio C HamanoSep 27, 2007
  16. Kelvie WongSep 27, 2007
  17. Junio C HamanoSep 27, 2007
  18. Junio C HamanoSep 27, 2007
  19. Kelvie WongSep 27, 2007
  20. Kelvie WongSep 27, 2007
  21. Junio C HamanoSep 27, 2007
  22. Junio C HamanoSep 27, 2007
  23. Kelvie WongSep 27, 2007
  24. Theodore TsoSep 27, 2007
  25. Kelvie WongSep 28, 2007
  26. David KastrupSep 28, 2007
  27. Theodore TsoSep 27, 2007
  28. David KågedalSep 28, 2007

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.