From: "Shawn O. Pearce" <spearce@spearce.org>
To: Yann Simon <yann.simon.fr@gmail.com>
Cc: Robin Rosenberg <robin.rosenberg.lists@dewire.com>,
git <git@vger.kernel.org>
Subject: Re: [PATCH JGIT] Add the signed-off in the commit text dialog
Date: Mon, 9 Feb 2009 07:46:27 -0800 [thread overview]
Message-ID: <20090209154627.GJ30949@spearce.org> (raw)
In-Reply-To: <499048FD.7050803@gmail.com>
Yann Simon <yann.simon.fr@gmail.com> wrote:
> The user can see and edit the signed-off in the commit dialog
> before committing.
>
> For new lines in the commit dialog, use Text.DELIMITER for
> plateform neutrality.
>
> Signed-off-by: Yann Simon <yann.simon.fr@gmail.com>
> ---
> This patch only applies after the 2 previous patches.
> If you want to, I could probably modify this patch so that it would
> apply on the current origin.
The other two have been applied so no need to rebase.
> diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/CommitDialog.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/CommitDialog.java
> index 9d062cc..8f85c08 100644
> --- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/CommitDialog.java
> +++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/CommitDialog.java
> @@ -67,6 +68,8 @@
> */
> public class CommitDialog extends Dialog {
>
> + private static Pattern signedOffPattern = Pattern.compile("(.|\r|\n)*Signed-off-by: .*(\r|\n)*"); //$NON-NLS-1$
Wouldn't "[.\r\n]" be easier to use here than "(.|\r|\n)"?
> @@ -214,6 +217,30 @@ public void widgetDefaultSelected(SelectionEvent arg0) {
> signedOffButton.setText(UIText.CommitDialog_AddSOB);
> signedOffButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());
>
> + signedOffButton.addSelectionListener(new SelectionListener() {
> + boolean alreadySigned = false;
> + public void widgetSelected(SelectionEvent arg0) {
> + if (alreadySigned)
> + return;
> + if (signedOffButton.getSelection()) {
> + alreadySigned = true;
Huh. So I can only push the checkbox once, and that after that
its just an idiot switch?
If that's really going to be how it is, maybe we should disable
the checkbox?
FWIW, git-gui actually looks for the user's Signed-off-by line in the
text buffer. If it can't find it, then it appends it onto the end.
That way the user can delete the line and do the sign off again if
they messed up somehow.
And actually, given that this is a checkbox and not a button, maybe
we should be able to *delete* the SBO line when the user tries to
uncheck the checkbox. Which then gets into, what if the user made
an edit to the text and changed the SBO line, should this box get
unchecked automatically by some form a listener on the text box?
Food for thought. I'm not sure what it should be. But if it were
a checkbox, as a user I'd like it to be bi-directional (both add
and remove my SBO) and also uncheck when I edit or delete the SBO
line in the message box.
--
Shawn.
next prev parent reply other threads:[~2009-02-09 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-09 15:17 [PATCH JGIT] Add the signed-off in the commit text dialog Yann Simon
2009-02-09 15:46 ` Shawn O. Pearce [this message]
2009-02-09 15:50 ` Yann Simon
2009-02-09 15:58 ` Shawn O. Pearce
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090209154627.GJ30949@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=robin.rosenberg.lists@dewire.com \
--cc=yann.simon.fr@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox