All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] moveconfig: Add a new --git-ref option
Date: Fri, 5 Jun 2015 13:54:43 +0900	[thread overview]
Message-ID: <CAK7LNARSK2ZR6hAC0wbCGen_9zfeuB2pVMNbzLjBf-S0eL0u2A@mail.gmail.com> (raw)
In-Reply-To: <1432934631-32654-1-git-send-email-joe.hershberger@ni.com>

Hi Joe,


2015-05-30 6:23 GMT+09:00 Joe Hershberger <joe.hershberger@ni.com>:
> This option allows the 'make *_defconfig' step to run against a former
> repo state, while the savedefconfig step runs against the current repo
> state. This is convenient for the case where something in the Kconfig
> has changed such that the defconfig is no longer complete with the new
> Kconfigs. This feature allows the .config to be built assuming those old
> Kconfigs, but then savedefconfig based on the new state of the Kconfigs.
>
> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


This idea seems nice, but I have some comments about the implementation.



> +    defconfig_src_dir = ''
> +
> +    if options.git_ref:
> +        work_dir = WorkDir()
> +        defconfig_src_dir = work_dir.get()
> +        cwd = os.getcwd()
> +        print 'Cloning git repo for \'make *_defconfig\' step...'

You can use signle quotes without escape sequences inside "...", and vice versa.





> diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
> index 9e739d8..138f989 100644
> --- a/tools/patman/gitutil.py
> +++ b/tools/patman/gitutil.py
> @@ -61,6 +61,21 @@ def CountCommitsToBranch():
>      patch_count = int(stdout)
>      return patch_count
>
> +def CommitHash(commit_ref):
> +    """Gets the hash for a commit
> +
> +    Args:
> +        commit_ref: Commit ref to look up
> +
> +    Return:
> +        Hash of revision, if any, else None
> +    """
> +    pipe = ['git', 'rev-parse', '--short', commit_ref]
> +    stdout = command.RunPipe([pipe], capture=True, oneline=True).stdout
> +
> +    hash = stdout.strip()
> +    return hash
> +
>  def NameRevision(commit_hash):
>      """Gets the revision name for a commit



Finally, this tool is going to depend on patman.  I am afraid this
tool is getting messy.

gitutils.py depends on command.py, and then command.py depends on
cros_subprocess.py.

Do you really need to invoke such a chain of libraries
to run a sub-process?


For example, you can get a hash in a single line like this:

subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'])





-- 
Best Regards
Masahiro Yamada

  parent reply	other threads:[~2015-06-05  4:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-29 21:23 [U-Boot] [PATCH] moveconfig: Add a new --git-ref option Joe Hershberger
2015-06-02 13:42 ` Joe Hershberger
2015-06-05  4:54 ` Masahiro Yamada [this message]
2015-06-10 14:16   ` Joe Hershberger
2016-06-02  3:30 ` [U-Boot] [PATCH v2 1/2] tools: moveconfig: Make the slot processing more linear Joe Hershberger
2016-06-02  3:30   ` [U-Boot] [PATCH v2 2/2] tools: moveconfig: Add a new --git-ref option Joe Hershberger
2016-06-08  2:56     ` Masahiro Yamada
2016-06-10 19:53     ` [U-Boot] [PATCH v3 1/4] tools: moveconfig: Fix another typo Joe Hershberger
2016-06-10 19:53       ` [U-Boot] [PATCH v3 2/4] tools: moveconfig: New color used for changed defconfig Joe Hershberger
2016-06-11 15:06         ` Masahiro Yamada
2016-06-12 22:31           ` Masahiro Yamada
2016-06-10 19:53       ` [U-Boot] [PATCH v3 3/4] tools: moveconfig: Fix bug in make Slot.poll() Joe Hershberger
2016-06-11 15:14         ` Masahiro Yamada
2016-06-10 19:53       ` [U-Boot] [PATCH v3 4/4] tools: moveconfig: Add a new --git-ref option Joe Hershberger
2016-06-11 15:09         ` Masahiro Yamada
2016-06-12 22:31           ` Masahiro Yamada
2016-06-11 15:05       ` [U-Boot] [PATCH v3 1/4] tools: moveconfig: Fix another typo Masahiro Yamada
2016-06-12 22:31         ` Masahiro Yamada
2016-06-08  2:47   ` [U-Boot] [PATCH v2 1/2] tools: moveconfig: Make the slot processing more linear Masahiro Yamada

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=CAK7LNARSK2ZR6hAC0wbCGen_9zfeuB2pVMNbzLjBf-S0eL0u2A@mail.gmail.com \
    --to=yamada.masahiro@socionext.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.