git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <cel@citi.umich.edu>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 6/7] Add a "--clone" option to "stg branch"
Date: Thu, 01 Dec 2005 16:47:53 -0500	[thread overview]
Message-ID: <438F6F89.7010004@citi.umich.edu> (raw)
In-Reply-To: <b0943d9e0512011305v3299f27au@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2180 bytes --]

Catalin Marinas wrote:
> On 29/11/05, Chuck Lever <cel@netapp.com> wrote:
> 
>>Cloning a branch means creating a new branch and copying all of the
>>original branch's patches and its base to it.  Like creating a tag,
>>but this also preserves all the StGIT patches as well.
> 
> [...]
> 
>>--- a/stgit/commands/branch.py
>>+++ b/stgit/commands/branch.py
> 
> [...]
> 
>>+        print 'Cloning current branch to "%s"...' % clone
> 
> 
> I would put a comma after this line and add sys.stdout.flush(). So
> that 'done' is shown on the same line.

d'oh!  that's left over from when the Series.clone() method actually 
printed the name of each patch as it was cloning.  fixed.

> [...]
> 
>>--- a/stgit/stack.py
>>+++ b/stgit/stack.py
> 
> [...]
> 
>>+    def clone(self, target_series):
>>+        """Clones a series
>>+        """
> 
> 
> Wouldn't it be easier to do a recursive copy at the directory level
> (.git/patches/<branch> into .git/patches/<clone> and
> .git/refs/bases/<branch> into .git/refs/bases/<clone>)? Is there
> anything that could go wrong if we do this?

well, then you'd also clone any junk files that were left in there (for 
example, development notes).

also, by doing this a patch at a time, it gives the ability to hook in 
additional functionality in the future, in case we want to do something 
special to each newly cloned patch, like mechanically change the patch 
names, or automatically add some annotation, for example.

it also automatically converts an old-style branch (patches and series 
control files in same directory) to a new-style branch (patches in 
separate directory from series control files).

it follows the same basic pattern of logic as "stg pick".  cloning a 
branch is kind of like 'picking' all of it's patches into a new branch.

but finally (and most practically speaking), i hunted around for Python 
code to copy a directory hierarchy, and interestingly enough it looks 
about as complicated (or maybe more complicated) than the clone 
implementation i finally came up with, which is only about 30 lines.  i 
suppose we could just do a "os.system('cp -r yada yada')" but that's 
just lame  ;^)  and it only works on UNIX.

[-- Attachment #2: cel.vcf --]
[-- Type: text/x-vcard, Size: 445 bytes --]

begin:vcard
fn:Chuck Lever
n:Lever;Charles
org:Network Appliance, Incorporated;Open Source NFS Client Development
adr:535 West William Street, Suite 3100;;Center for Information Technology Integration;Ann Arbor;MI;48103-4943;USA
email;internet:cel@citi.umich.edu
title:Member of Technical Staff
tel;work:+1 734 763 4415
tel;fax:+1 734 763 4434
tel;home:+1 734 668 1089
x-mozilla-html:FALSE
url:http://www.monkey.org/~cel/
version:2.1
end:vcard


  reply	other threads:[~2005-12-01 21:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-29 22:05 [PATCH 0/7] Chuck Lever
2005-11-29 22:09 ` [PATCH 1/7] Make "stg export" save the base commit in the output directory Chuck Lever
2005-11-30 21:53   ` Catalin Marinas
2005-11-29 22:09 ` [PATCH 2/7] Use git-rev-parse to find the local GIT repository Chuck Lever
2005-11-29 22:09 ` [PATCH 3/7] Align branch descriptions in output of "stg branch -l" Chuck Lever
2005-11-29 22:09 ` [PATCH 4/7] "stg series" option to show patch summary descriptions Chuck Lever
2005-11-29 22:09 ` [PATCH 5/7] Add facility to print short list of patches around 'top' Chuck Lever
2005-11-29 22:09 ` [PATCH 6/7] Add a "--clone" option to "stg branch" Chuck Lever
2005-12-01 21:05   ` Catalin Marinas
2005-12-01 21:47     ` Chuck Lever [this message]
2005-11-29 22:09 ` [PATCH 7/7] Use a separate directory for patches under each branch subdir Chuck Lever
2005-11-30 22:23   ` Catalin Marinas
2005-11-30 22:28     ` Chuck Lever
2005-11-30 22:32       ` Catalin Marinas
2005-12-01  2:53         ` Chuck Lever
2005-11-30 22:27 ` [PATCH 0/7] Catalin Marinas

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=438F6F89.7010004@citi.umich.edu \
    --to=cel@citi.umich.edu \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).