From patchwork Tue Feb 26 05:17:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matheus Tavares X-Patchwork-Id: 10829443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0373D17E6 for ; Tue, 26 Feb 2019 05:18:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E38A82AF61 for ; Tue, 26 Feb 2019 05:18:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D76312B150; Tue, 26 Feb 2019 05:18:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B4282AF61 for ; Tue, 26 Feb 2019 05:18:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725981AbfBZFSP (ORCPT ); Tue, 26 Feb 2019 00:18:15 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:42459 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725940AbfBZFSP (ORCPT ); Tue, 26 Feb 2019 00:18:15 -0500 Received: by mail-qt1-f195.google.com with SMTP id u7so4310364qtg.9 for ; Mon, 25 Feb 2019 21:18:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp-br.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=erOxxYzSC0ZYOOLqx/nqefV3u2RFvLBb2D6uWuYqnZ4=; b=iqxGBa/WHqB2PSNYSAizuef+Z5EBFT8knTqzcFvovSmq4CMZvfKWDlibMzeSD6vy75 mGH1wS697+D6uyCeEiO+UG2PIV8gklU0oT/4tZxyyVNvCjczB3YMWFWn88Rxa/i9QrTe ndBTk2C7nRM47uMit4MgcE7FpxDkg7Ony2VkOwTwEZxqa2ZbrZTvsuj2uGX0pYMItowA Q7uQ1OyCwgtfVsbAdcu2BeAERdeTGfFXDoeHkmK9hVxm11gQcNTCv+8/evWZr1X0jT5U dIDneQYfNCnaL/hhXYhSEorhVcHUuDfuRAmmN7daD0m3mbjS1umsAuPD9Q9IP3OEini0 bk/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=erOxxYzSC0ZYOOLqx/nqefV3u2RFvLBb2D6uWuYqnZ4=; b=Jyxrw8ycgCq7NhELnUR9fpMaWOX4fL4SAaJG49J3IHLIn07150W+VLRchMJEch8S78 hbb9k2iEmOh8FZLQROk75IvwPG2TGC6KvIHPTpOuG7z4WDVs+3Fde8B22cgUz1ZjFkvv A/DseeLV2yRPUSn310+98T7fle3B7PmOhNKFVSs23aC0C4f25IYEKzK6cee2T2+uNbda 4HSvSqBBKQMoI7F0S4xF1A5MAek9ZntQZC7C7X+c/bwzQyP0esvskg1Wqp5meg7tlZru j2gaRDpkSnF7X7icAxJ7iTv4/VzuxITxTWoTB4M3Z87cUp7h4gq15kf8mUmUcqsOk2/w 5oeg== X-Gm-Message-State: AHQUAubK63jo1DsRAuUrhEPvuWGcgSt1DBATqC/09eE0U7/IIFSuVUST 09UIFSO9jHhKAZuQBOMg9zbDdmmCJpc= X-Google-Smtp-Source: AHgI3IbK1hN7TNCQcqTY9JdOJSiYv1FcWj6SWujPYFgMwViNJTj0PqOJIP7vwektaVq18qESxd67Uw== X-Received: by 2002:a0c:b527:: with SMTP id d39mr16677383qve.201.1551158293777; Mon, 25 Feb 2019 21:18:13 -0800 (PST) Received: from mango.spo.virtua.com.br ([2804:14c:81:942d::3]) by smtp.gmail.com with ESMTPSA id k39sm7698738qtb.37.2019.02.25.21.18.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 21:18:13 -0800 (PST) From: Matheus Tavares To: git@vger.kernel.org Cc: Thomas Gummerer , =?utf-8?b?w4Z2YXIgQXJuZmrDtnI=?= =?utf-8?b?w7AgQmphcm1hc29u?= , Christian Couder Subject: [WIP RFC PATCH v2 0/5] clone: dir iterator refactoring with tests Date: Tue, 26 Feb 2019 02:17:59 -0300 Message-Id: <20190226051804.10631-1-matheus.bernardino@usp.br> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ævar sent v1: https://public-inbox.org/git/20190226002625.13022-1-avarab@gmail.com/ Based on Ævar's work and comments, I refactored my previous series[1], so that clone's original behaviour regarding symlinks is kept untouched. So, keeping this behaviour, having tests for this, changing local clone to use dir-iterator's API and modifing hidden paths behaviour (which we agreed to seem like unintentional), I think this version addresses all the comments and concerns raised in this thread: https://public-inbox.org/git/CAP8UFD2xrfMHNxcmeYf8G+d53SL26N07FFAoDP+e0h3r-tvKQw@mail.gmail.com/ And also addresses the comments I made in WIP's v1. [1]: https://public-inbox.org/git/20190223190309.6728-1-matheus.bernardino@usp.br/ Matheus Tavares (4): dir-iterator: add flags parameter to dir_iterator_begin clone: copy hidden paths at local clone clone: extract function from copy_or_link_directory clone: use dir-iterator to avoid explicit dir traversal Ævar Arnfjörð Bjarmason (1): clone: test for our behavior on odd objects/* content builtin/clone.c | 70 ++++++++++++++++++++++---------------- dir-iterator.c | 28 +++++++++++++-- dir-iterator.h | 40 +++++++++++++++++----- refs/files-backend.c | 2 +- t/t5604-clone-reference.sh | 69 +++++++++++++++++++++++++++++++++++++ 5 files changed, 168 insertions(+), 41 deletions(-)