git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Hervé Beraud" <herveberaud.pro@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] make hg-to-git compatible with python2.x and 3.x
Date: Thu, 15 Feb 2018 14:06:55 -0800	[thread overview]
Message-ID: <xmqq4lmh9abk.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <01020161992fe7ce-b41bf370-1480-4efe-8980-0c52fb9b9be5-000000@eu-west-1.amazonses.com> ("Hervé Beraud"'s message of "Thu, 15 Feb 2018 11:18:29 +0000")

Hervé Beraud <herveberaud.pro@gmail.com> writes:

> ---

Thanks for posting, but this is way under-justified, even for
something in contrib/ area.  

Are all changes in this patch necessary to "make it compatible with
both Python 2 and 3", or are some parts do not contribute directly
to the objective but are good changes to suit your personal taste,
match BCP styles, etc.?  I am guessing it is the latter (e.g. with
Python 3, you cannot use print without invoking it as a function,
but os.system() can still accept a literal command line string, so
introducing variable "rm_f" that gets assigned a literal string only
once to pass it to os.system() does not have anything to do with the
Python2to3 transition), and if that is the case, it makes sense to
split this into at least 2 patches, i.e. prelimiary clean-up,
followed by changes required to run it with Python3.  It also is OK
to make it a 3-patch series, in which case you would limit the
preliminary clean-up to minimum uncontroversial changes and follow
up with an optional update to suit personal taste at the very end.

Also, the submission needs to be signed-off for us to be able to
use.  Please see Documentation/SubmittingPatches for details.

Thanks.

>  contrib/hg-to-git/hg-to-git.py | 140 ++++++++++++++++++++++++-----------------
>  1 file changed, 83 insertions(+), 57 deletions(-)
>
> diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py
> ...
>      os.system('git ls-files -x .hg --others | git update-index --add --stdin')
>      # delete removed files
> -    os.system('git ls-files -x .hg --deleted | git update-index --remove --stdin')
> +    rm_f = 'git ls-files -x .hg --deleted | git update-index --remove --stdin'
> +    os.system(rm_f)
>  ... 
> @@ -247,7 +273,7 @@ def getgitenv(user, date):
>  # write the state for incrementals
>  if state:
>      if verbose:
> -        print 'Writing state'
> +        print('Writing state')
>      f = open(state, 'w')
>      pickle.dump(hgvers, f)
>  
>
> --
> https://github.com/git/git/pull/458

  reply	other threads:[~2018-02-15 22:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 11:18 [PATCH] make hg-to-git compatible with python2.x and 3.x Hervé Beraud
2018-02-15 22:06 ` Junio C Hamano [this message]
2018-02-20 16:52 ` Hervé Beraud
2018-02-20 19:14   ` Junio C Hamano
2018-02-20 19:19     ` Junio C Hamano
2019-09-17 13:41   ` [PATCH] Rewrite feature to render " Hervé Beraud
2019-09-17 22:35     ` Junio C Hamano
2019-09-17 22:40       ` Junio C Hamano
2019-09-18  8:33     ` [PATCH v2] hg-to-git: make it compatible with both python3 and python2 Hervé Beraud
2019-09-18 17:21       ` Junio C Hamano
2019-09-18 17:55       ` [PATCH v3] " Hervé Beraud

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=xmqq4lmh9abk.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=herveberaud.pro@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).