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

Re: [PATCH 1/2] git svn dcommit: new option --interactive.

From
EWEric Wong <normalperson@yhbt.net>
Date
Sep 6, 2011, 20:26 UTC
Message-ID
<20110906202601.GA11668@dcvr.yhbt.net>
In-Reply-To
<1315164113-26539-2-git-send-email-frederic.heitzmann@gmail.com>
Frédéric Heitzmann <frederic.heitzmann@gmail.com> wrote:
Show 7 quoted lines
> Allow the user to check the patch set before it is commited to SNV. It is then
> possible to accept/discard one patch, accept all, or quit.
> 
> This interactive mode is similar with 'git send email' behaviour. However,
> 'git svn dcommit' returns as soon as one patch is discarded.
> 
> Part of the code was taken from git-send-email.perl
> Thanks-to: Eric Wong <normalperson@yhbt.net> for the initial idea.
> Signed-off-by: Frédéric Heitzmann <frederic.heitzmann@gmail.com>
I agree with this feature, a few comments inline.
>  I would have preferred not duplicating the code snippets taken from
>  git-send-email ('ask' function, Term related code, ...) but I preferred not
>  to spoil Git.pm with it.
>  Any comment on a better way to factor perl code would be appreciated.

We should put this into Git.pm at some point. (Somebody should refactor git-svn.perl into separate files too... :x)

>  Documentation/git-svn.txt |    8 +++++
>  git-svn.perl              |   71 ++++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 78 insertions(+), 1 deletions(-)
Tests and feature should be the same patch
> +	return defined $default ? $default : undef
> +		unless defined $term->IN and defined fileno($term->IN) and
> +		       defined $term->OUT and defined fileno($term->OUT);
Things to make life easier for (mainly) C programmers:
* Use C-style "&&" and "||" for conditionals.  "and" and "or" are lower
  precedence and better used for control flow (see perlop(1) manpage).
* Also, use parentheses for defined(foo) to disambiguate multiple
  conditions/statements.
-- 
Eric Wong
Previous: Frédéric HeitzmannNext: Frédéric Heitzmann
Message 3 of 5 in “git svn dcommit : new option --interactive”
  1. git svn dcommit : new option --interactiveFrédéric Heitzmann, Sep 4, 2011
  2. 1/2 git svn dcommit: new option --interactive.Frédéric Heitzmann, Sep 4, 2011
  3. Eric WongSep 6, 2011
  4. Frédéric HeitzmannSep 7, 2011
  5. 2/2 git svn dcommit: add a test serie for 'git svn dcommit --interactive'Frédéric Heitzmann, Sep 4, 2011

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.