git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jacob Nisnevich <jacob.nisnevich@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] mergetools: created new mergetool file for ExamDiff
Date: Sun, 20 Mar 2016 20:32:01 -0700	[thread overview]
Message-ID: <20160321033201.GA2004@gmail.com> (raw)
In-Reply-To: <xmqqfuvkod6o.fsf@gitster.mtv.corp.google.com>

On Sun, Mar 20, 2016 at 06:02:55PM -0700, Junio C Hamano wrote:
> Jacob Nisnevich <jacob.nisnevich@gmail.com> writes:
> 
> > ---
> 
> Missing sign-off.
> 
> I'll Cc the area expert (David Aguilar).
> 
> >  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).

I agree with that.

Something like mergetool_find_win32_cmd() might make sense as a
helper function that we can reuse here.

> > +}
> > \ No newline at end of file
> 
> No newline at end of file?

Using sublime text perhaps?
It defaults to not including the final line newline terminator.

https://forum.sublimetext.com/t/make-saving-newline-at-eof-the-installation-default/9842

If so, please configure it as detailed in the above thread.

cheers,
-- 
David

  reply	other threads:[~2016-03-21  3:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-20  4:58 [PATCH] mergetools: created new mergetool file for ExamDiff Jacob Nisnevich
2016-03-21  1:02 ` Junio C Hamano
2016-03-21  3:32   ` David Aguilar [this message]
2016-03-23  0:43     ` [PATCH 0/2] Helper function for ExamDiff and Winmerge mergetools Jacob Nisnevich
2016-03-23  0:43       ` [PATCH 1/2] mergetools: created new mergetool file for ExamDiff Jacob Nisnevich
2016-03-23  0:43       ` [PATCH 2/2] created helper function for both winmerge and examdiff mergetools Jacob Nisnevich
2016-03-23  2:41         ` Junio C Hamano
2016-03-23 22:55           ` [PATCH] mergetools: implemented new mergetool file for ExamDiff Jacob Nisnevich
2016-03-23 22:55             ` Jacob Nisnevich
2016-03-24  7:44               ` David Aguilar
2016-03-24 15:43                 ` Junio C Hamano
2016-03-25 22:52                   ` [PATCH 0/2] add support " Jacob Nisnevich
2016-03-25 22:52                     ` [PATCH 1/2] mergetools: create mergetool_find_win32_cmd() helper function for winmerge Jacob Nisnevich
2016-03-25 23:00                       ` Junio C Hamano
2016-03-25 23:17                         ` [PATCH 0/2] mergetools: add support for ExamDiff Jacob Nisnevich
2016-03-25 23:17                           ` [PATCH 1/2] mergetools: create mergetool_find_win32_cmd() helper function for winmerge Jacob Nisnevich
2016-03-25 23:17                           ` [PATCH 2/2] mergetools: add support for ExamDiff Jacob Nisnevich
2016-04-01 18:10                           ` [PATCH 0/2] " Junio C Hamano
2016-04-02 21:02                             ` David Aguilar
2016-03-25 22:52                     ` [PATCH 2/2] " Jacob Nisnevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160321033201.GA2004@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.nisnevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).