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

Re: [PATCH] mergetools: created new mergetool file for ExamDiff

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 21, 2016, 01:02 UTC
Message-ID
<xmqqfuvkod6o.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1458449932-24342-1-git-send-email-jacob.nisnevich@gmail.com>
Jacob Nisnevich <jacob.nisnevich@gmail.com> writes:
> ---
Missing sign-off.
I'll Cc the area expert (David Aguilar).
Show 46 quoted lines
>  mergetools/examdiff | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 mergetools/examdiff
>
> diff --git a/mergetools/examdiff b/mergetools/examdiff
> new file mode 100644
> index 0000000..474fffe
> --- /dev/null
> +++ b/mergetools/examdiff
> @@ -0,0 +1,37 @@
> +diff_cmd () {
> +	"$merge_tool_path" "$LOCAL" "$REMOTE" -nh
> +}
> +
> +merge_cmd () {
> +	touch "$BACKUP"
> +	if $base_present
> +	then
> +		"$merge_tool_path" -merge "$LOCAL" "$BASE" "$REMOTE" -o:"$MERGED" -nh
> +	else
> +		"$merge_tool_path" -merge "$LOCAL" "$REMOTE" -o:"$MERGED" -nh
> +	fi
> +	check_unchanged
> +}
> +
> +translate_merge_tool_path() {
> +	# Use ExamDiff.com if it exists in $PATH
> +	if type -p ExamDiff.com >/dev/null 2>&1
> +	then
> +		printf ExamDiff.com
> +		return
> +	fi
> +
> +	# Look for ExamDiff.com in the typical locations
> +	examdiff="ExamDiff Pro/ExamDiff.com"
> +	for directory in $(env | grep -Ei '^PROGRAM(FILES(\(X86\))?|W6432)=' |
> +		cut -d '=' -f 2- | sort -u)
> +	do
> +		if test -n "$directory" && test -x "$directory/$examdiff"
> +		then
> +			printf '%s' "$directory/$examdiff"
> +			return
> +		fi
> +	done
> +
> +	printf ExamDiff.com

This complicated heuristics look like a cut-and-paste from the neighbouring winmerge; makes me suspect that they should share the same helper function to implement the bulk of the above code for better maintainability (e.g. imagine in the future Microsoft decides to introduce another directory organization and makes it necessary to tweak the pattern you give to 'grep -Ei'---WinMergeU user may notice that and fix it, while this script will be overlooked and will stay stale until somebody from examdiff camp do the same fix later).

> +}
> \ No newline at end of file
No newline at end of file?
Previous: Jacob NisnevichNext: David Aguilar
Message 2 of 20 in “mergetools: created new mergetool file for ExamDiff”
  1. mergetools: created new mergetool file for ExamDiffJacob Nisnevich, Mar 20, 2016
  2. Junio C HamanoMar 21, 2016
  3. David AguilarMar 21, 2016
  4. 0/2 Helper function for ExamDiff and Winmerge mergetoolsJacob Nisnevich, Mar 23, 2016
  5. 1/2 mergetools: created new mergetool file for ExamDiffJacob Nisnevich, Mar 23, 2016
  6. 2/2 created helper function for both winmerge and examdiff mergetoolsJacob Nisnevich, Mar 23, 2016
  7. Junio C HamanoMar 23, 2016
  8. mergetools: implemented new mergetool file for ExamDiffJacob Nisnevich, Mar 23, 2016
  9. mergetools: implemented new mergetool file for ExamDiffJacob Nisnevich, Mar 23, 2016
  10. David AguilarMar 24, 2016
  11. Junio C HamanoMar 24, 2016
  12. 0/2 add support for ExamDiffJacob Nisnevich, Mar 25, 2016
  13. 1/2 mergetools: create mergetool_find_win32_cmd() helper function for winmergeJacob Nisnevich, Mar 25, 2016
  14. Junio C HamanoMar 25, 2016
  15. 0/2 mergetools: add support for ExamDiffJacob Nisnevich, Mar 25, 2016
  16. 1/2 mergetools: create mergetool_find_win32_cmd() helper function for winmergeJacob Nisnevich, Mar 25, 2016
  17. 2/2 mergetools: add support for ExamDiffJacob Nisnevich, Mar 25, 2016
  18. Junio C HamanoApr 1, 2016
  19. David AguilarApr 2, 2016
  20. 2/2 mergetools: add support for ExamDiffJacob Nisnevich, Mar 25, 2016

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.