[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

commit dialog behaviour on check-commit-hook

From: Jens Wilhelm <willorix-tsvndev_at_yahoo.de>
Date: Mon, 12 Sep 2016 02:13:28 -0700 (PDT)

I down't no what was wrong with my question that I got no answer to my first posting. :-( So I'll try again.

As I read the documentation, the purpose of Check-commit hook ist to check the files selected in commit dialog after the user presses OK. And if the hook script detects some problems, it should return an error and a list of affected files. So the user can decide if he really wants to do the commit.

The current behaviour in case of an error returned by the hook script is a dialog with the choice between two actions:
1 Abort: You can fix the reason the hook script failed first.
2 Proceed anyway: Ignore the hook script and run the command anyway.

Choosing one of these options the behaviour of commit dialog is clear and it works like expected. But what should happen if the user cancels the dialog by pressing Escape-key or simply closing the dialog without making a choice? Action 1, action 2 or even do nothing? The current source code says: "If the choice is 1 then do some selection due to the error message and keep commit dialog open, do the commit otherwise." The latter is not what I'd expect on cancelling the dialog box containing the error message. But this is what happens. I would prefer proceeding would only take place if the user choice is: "Proceed anyway".

In other words:
/trunk/src/TortoiseP​roc/CommitDlg.cpp Rev. 27110 Line 537

I would replace:
  bool doIt = (taskdlg.DoModal(GetSafeHwnd()) == 1);
by:
  bool doIt = (taskdlg.DoModal(GetSafeHwnd()) != 2);
where doIt stands for "Abort".

I may be wrong or the topic may be completely irrelevant, but please, give me an answer.

Regards

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3185518

To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2016-09-12 17:18:48 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.