From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH 1/3] Rename patch_update_file function to patch_update_pathspec Date: Sun, 25 Nov 2007 10:11:09 -0800 Message-ID: <7vzlx2mc02.fsf@gitster.siamese.dyndns.org> References: <1195996542-86074-1-git-send-email-win@wincent.com> <1195996542-86074-2-git-send-email-win@wincent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org, peff@peff.net To: Wincent Colaiuta X-From: git-owner@vger.kernel.org Sun Nov 25 19:13:10 2007 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1IwLx7-0004Mm-PI for gcvg-git-2@gmane.org; Sun, 25 Nov 2007 19:11:34 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753543AbXKYSLP (ORCPT ); Sun, 25 Nov 2007 13:11:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753525AbXKYSLP (ORCPT ); Sun, 25 Nov 2007 13:11:15 -0500 Received: from sceptre.pobox.com ([207.106.133.20]:53793 "EHLO sceptre.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753385AbXKYSLO (ORCPT ); Sun, 25 Nov 2007 13:11:14 -0500 Received: from sceptre (localhost.localdomain [127.0.0.1]) by sceptre.pobox.com (Postfix) with ESMTP id 3F7082F2; Sun, 25 Nov 2007 13:11:36 -0500 (EST) Received: from pobox.com (ip68-225-240-77.oc.oc.cox.net [68.225.240.77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by sceptre.sasl.smtp.pobox.com (Postfix) with ESMTP id C4B189995C; Sun, 25 Nov 2007 13:11:32 -0500 (EST) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Wincent Colaiuta writes: > The patch_update_file function really works on pathspecs, not files, so > rename it to reflect its actual purpose. I do not think this is a correct change. patch_update_file() should work on files not pathspecs. A list of exact pathnames are valid pathspecs, and because the matching function takes exact match first, if you feed a command (e.g. diff-files) paths expanded from the pathspec given by the user, you should be able to get desired results, no? patch_update_cmd() grabs list of modified _files_, not pathspecs. Then the user chooses the ones to select hunks from via list_and_choose(), and you may want to pretend that everything was chosen if you are operating with pathspec and with --patch option. Iterating over them is iterating over files, not pathspecs, at that point. Have you tried the one that is in 'next'? I think it does the right thing except "the bogus pathspec validation at the beginning" part as far as the pathspec handling is concerned. I sent out two fixes on top of the series.