From patchwork Wed Feb 12 03:26:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971080 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8DEE27183B for ; Wed, 12 Feb 2025 03:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330836; cv=none; b=Ubt848Fydm4kT5RVC7dnbbCH18pdwSnFcYcFMacGTth69U5CMB+NLjWoIJaCnPpMVjFbrnAyrOoaBDMVq6xm9+XRsBQXc/zWm7vmupGd61GaWgceXnKzwaxgXBFqyls/BXdo6eTXUUOyXNGl8MKrbrqAg6lDG9EQtFO/nzHE3oo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330836; c=relaxed/simple; bh=Rr6m/A9IQb396HWEa+1Qnky1V1CFb9AfduJm2EFAYOo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mKdv00YSb8PmvwuDlofH04gXaIJRza4CiUgxs/pUksWTD7PdIK75KMPjvxLtb7IydOEDwrawRcT/olH2g2h/XQl3p7Xyz+5yWXcPRyZYfBoc++rQSyWtHdTgTZZzqBLUaqa/JXdPhQel1YKOVK/9FL0RI62sRkEVy64WJd5vujE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eWuUj3PU; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eWuUj3PU" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-21f7f03d856so62832505ad.1 for ; Tue, 11 Feb 2025 19:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330834; x=1739935634; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VKzQoKAngCs6HWu9yDO+usfiXV22m58qAkD3sftzJCg=; b=eWuUj3PUWSgwa7yc/nIEGgVXCY0zuK8AwvsO6grSlY26pagu0YkykzV4bpA1nGMSHn To3w9OLC1kzZq9RqFoncZXPzIdWsedu5YqwViAO/ob7q8SoLqYqiWY6xnpBUc9Bn4L8p co3YQClbWvqRmil+a2jroJjjT/ge4t4xq0k/J5Y6UEOXiEongA6EzCHKfF69Z4vDJvFE KPHf0S/28Q7B9B0IpJhSrHCCgRZtHW5dYU7DwZmDKShy9bSROo2PZMBpL0G6ELTFbz6F 5fESja/6casd5ETM4sI+tmITjVVCVZkhOUdnpXRF41tzT+X+KilU9Wxl5vtbCuCQ6YmH iU9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330834; x=1739935634; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VKzQoKAngCs6HWu9yDO+usfiXV22m58qAkD3sftzJCg=; b=uq8TA6t2YtV9oY3tmor351UpF0dJ4CJ/FHtFkTqfEyVdvf+KpJ6C1d4WCUyFJYH16w bkqpPdfVYlfcsZCK+qqyrpodT9zf8FJ7C5EZd7q7MFYLgkIV2ip41iLB5CHCSagjZysx mP4qUz7B4owc/qWnfLj9IS0Z81cTffiUI3WahxygKPXXLPl6efSV9PLwYeNnDYk/1IIx P47cDFuo55jI/obbY1mwODoF8NjJuTzc8kEHAMUqKhHgqEqFL+J/7jAROeat0I0vzYqI gvQpm133GAD4volE3bjnOyozY92agIDRcU1ITorTQyqk4fpFbejZ2GGI7caNdBRDvB1U c/RQ== X-Forwarded-Encrypted: i=1; AJvYcCXLczZXYv/h8u6vA1EoQwbTHle9DIK63S33uwxjInzZ7DEZlmf5+G1cC3Ioo5wMIokQxsk=@vger.kernel.org X-Gm-Message-State: AOJu0YypTKrQEuQ0bSgq/6WnTb1M8j5RAhZ5FiwY5xBMwSmGoL3poxUv 4QoX65+/mQb8E5tefJDzqGUZ3K87gK+ywKdOAeHipQIIkVM9rMdV X-Gm-Gg: ASbGncuG4JIgwo/8hAborbuLR80VrCIGGQiJY633/hQLf9jdsCBs+B9zvytNCudPgoV uM+0ZCMLnjSZLv8PCaegNXGaHkzl3BsexGS5Qf/k9ZOKV9t+iu2WDzNntKXr6KC0PyrpLmA1mZi RE7OMiy2+kzFo6MbnIXPxJ9r1TQJtvoEsPJmo/B1C9smpacUQy3GQah3Hx8n/VvaAOX9D3r848n OekecLl1aXUGE8+Gq9ZycojK1mCHp5bhOHq+MmBxrr1o357W6j/BTqjGjLQzvGgZTqWzm8IazfG 2vEUENTzL9Lv+x90keXf97p3q5C4F36HPM6k2L8= X-Google-Smtp-Source: AGHT+IGH4YoDm8lG0E7Kenoo0hz/BMKCYf3ns/UKm3pkk/49tMTBtcRz7vjOX9/oPcE7ADEmBj6OyQ== X-Received: by 2002:a05:6a21:695:b0:1e4:80a9:3fb8 with SMTP id adf61e73a8af0-1ee5c73efa7mr3001366637.16.1739330834191; Tue, 11 Feb 2025 19:27:14 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:13 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 01/10] t/t4209-log-pickaxe: Naming typo: -G takes a regex Date: Tue, 11 Feb 2025 19:26:45 -0800 Message-ID: <20250212032657.1807939-2-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Not effect on the test logic, but as "-G" argument is a regex it is more accurate to use "regex" as a dummy argument value rather than "string". In all the other case when "-G" is passed a dummy value it is spelled as "regex" rather than as "string". --- t/t4209-log-pickaxe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh index a675ac..ed70c 100755 --- a/t/t4209-log-pickaxe.sh +++ b/t/t4209-log-pickaxe.sh @@ -89,7 +89,7 @@ test_expect_success 'usage: --no-pickaxe-regex' ' test_expect_code 128 git log -Sstring --no-pickaxe-regex 2>actual && test_cmp expect actual && - test_expect_code 128 git log -Gstring --no-pickaxe-regex 2>err && + test_expect_code 128 git log -Gregex --no-pickaxe-regex 2>err && test_cmp expect actual ' From patchwork Wed Feb 12 03:26:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971081 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C30271D95A9 for ; Wed, 12 Feb 2025 03:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330837; cv=none; b=fE5tTHTJlXno4MtIYi8LgByvj/3pj+PHZGc1gQCDD1NM1W/TDUwgQjY1LN5BJSrnycF/I2us8cv/0o/qVkpdmlpR4KyXFEMxAOedOo0SMo3xT/s3I1TmQZTONLKLofLskyoszLYm4Ip3d8TYQB8s7JYvwpLOtR997MPTy+tXRGo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330837; c=relaxed/simple; bh=65jF1Kbg8pmJoPHIj9oX2H0kaQiQ1E4nXq89L/GPzWI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mag/lbV3oMhDjM6wIaVAB2UmlI0o53/m4En3iR9xxfif/t11dCUsPfrLVwmww7ljp0OOUerHOr94TcN/XWFyVELV/+nKGbbkA1lzZwlX060FJYEMxhGvRD73nDgogrfyIkPavfWmn7jkjNXSHlUW1LAZsE7CKi+qfWw81uWmY8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Irc5wZxj; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Irc5wZxj" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-220bff984a0so3723525ad.3 for ; Tue, 11 Feb 2025 19:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330835; x=1739935635; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RUVxVdfdEGtwV6OWjbDz6WqfhYfQoLL9SeacMktxfpA=; b=Irc5wZxj2cX+jGhLLy5Er3c0MQicHMnmGV/ezGDmxj6pcD9CX2UYLIY8HFzNw/Upo8 3JTcvUs693LXlfBgA0ksDrhl+KG7Vy8Z5yC+x4IFcRahPX3zKo/KMz8ycWsauxlzSrRa YGBtAB1qEsEmkGNGtB+dELM6d7s4E8YbGRr7vEbjnluCEQADWP9xqtfaKVIV5NUGSe4k NYdfZGnDES25gmuHS9cBFAtcYDz7GNDWUK0zN0gK+zrSyJHJWl3m3REnMwdSlBQdXjZz ZEWATZxMzbdn8FMKGIOTY+K2rkMu19ClMaWN2MBvMA8pXEtiqSv9qw7ewQc/rPlySC76 KIKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330835; x=1739935635; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RUVxVdfdEGtwV6OWjbDz6WqfhYfQoLL9SeacMktxfpA=; b=jPo54drF8PPvky/gCbm0XxxzTR6lCBgD30DK1w2xim4tN1cW5Qo2cATMqXp1YvfCby iQzoDL+29ABRhBw5G6mZTZRchl0osg4g1KEuTMKEz1dT81EUSOU8Z6ctoMMEajB9HHb8 oYNzYlQ6fIVTyBxWSjUOS+UcuEW/7HeU2HN+XPus+ii5fvaVC1HvXbFnEgU4w5DRlPJW TfLWJ22xpiYnx/oYLubJr3/nX0x9RBEL1hGKtzuCgtaCZg4FYKMAUFY8QESkdITCAJN/ srQrIqNohS4pbyPZwkkGFETgWzOkRUjs8LmY4sCTOBRk4+iFiDgSNIxOh5WuDzr7Y3dV Hzkw== X-Forwarded-Encrypted: i=1; AJvYcCWryGJ7xSy49dNenKuAK4x6JHNOjFGPRxNZaGaRNNVa0wSS8NF8KEGx5zeIl/rf6ILaGW0=@vger.kernel.org X-Gm-Message-State: AOJu0YzB7vclOjuuVBB2dOL5fLOpKjmB5k9RU1tS8PRPtksETONMCs2Y mnuTgEVOuAn2LPWgGX9+MxOa27mSjTkookvQSAiWb83LIfuVZql8AsKbNMF3Yk0= X-Gm-Gg: ASbGncuCort7gZSs7jT0OI4u96rc1LUc2z8LqkUkYlBON+e7GXaD2dbImiwCbp5urjm ASPti15rhy4e65B3C9WuOfCOgl7/7dO1NPQedTp3UN9LKBKgm+WoOeu03RaaY5cLKe4eX7Z1diJ CSNjb37lVxk+vlubwdpeVDkb7xT1+NCJDEapWJJDpl/vNnr9RoPaDB3ZgafXQ2MJPIsoJGsbvE5 9fgVftrvCQav9NpLf6ZHQS3ydrc+h2Gb0RHfm2cnFkQFg5Hs3AoqrocFjj1m0/8aFbMFoj4Hiqs yznn/tIaf6JxwqpRUwCpsKZ1WG1i2an00NXIclE= X-Google-Smtp-Source: AGHT+IGqfjqOWZU5wUZQ8AME9ldC2kmGZpaMVLwCnDE7igeY3+P3o32YFs/kq01gqkLtVwnP+0qPSg== X-Received: by 2002:a05:6a20:9145:b0:1e0:ae58:2945 with SMTP id adf61e73a8af0-1ee5c822982mr3300450637.31.1739330835058; Tue, 11 Feb 2025 19:27:15 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:14 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 02/10] diff: -G description: Correct copy/paste error Date: Tue, 11 Feb 2025 19:26:46 -0800 Message-ID: <20250212032657.1807939-3-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Current description for -G is incorrect, seems like it was copied from the description for -S. --- diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff.c b/diff.c index 019fb..bd9db 100644 --- a/diff.c +++ b/diff.c @@ -5866,7 +5866,7 @@ struct option *add_diff_options(const struct option *opts, N_("look for differences that change the number of occurrences of the specified string"), 0, diff_opt_pickaxe_string), OPT_CALLBACK_F('G', NULL, options, N_(""), - N_("look for differences that change the number of occurrences of the specified regex"), + N_("look for differences where a patch contains the specified regex"), 0, diff_opt_pickaxe_regex), OPT_BIT_F(0, "pickaxe-all", &options->pickaxe_opts, N_("show all changes in the changeset with -S or -G"), From patchwork Wed Feb 12 03:26:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971083 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 394021DC9B0 for ; Wed, 12 Feb 2025 03:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330839; cv=none; b=OkMuk8Ib9eIbHQlJzO8tGhiCh3j73pxwP4xOWmvMq6WlDo99iX9epKyj27ad6MbFUUIRTY+nTV7RKG0VFouWsCK0IFpTnwx+NM6N6JshzK+TsQmYaFbtt7Cj2QDXC6KMHRLn1BG4tLBGluQOaHjyWzbb2Sy8+WeXpbAHUtuG8SY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330839; c=relaxed/simple; bh=17N7VocmfZJeVnuHq/f0+bycl3xpueu5wz51Z3gMyA4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ArALWMKPIbipctzEjbitaCUqHckHfPFeUNfDqeY238kSt/E3EMqIS4d3nXDKPRRL3W/YQ/78PCmwk8e9/19c/eR3/5VdoIoo2cgvGWK5ckH9FBmOfbxl2K4eyGp3ZNHA/MfSfX9bYvGtWnwxFfAuX0nc5eD5QsAuAemTKs12bJw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZudPFNc/; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZudPFNc/" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-219f8263ae0so112115045ad.0 for ; Tue, 11 Feb 2025 19:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330836; x=1739935636; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tTlfV8sxLAVM5HmOqiScCyvjUdi07C2Elp61HaMzN3c=; b=ZudPFNc/+7q5jPn18pqjHxwDv57Joq6e2dpqj87kkVJ1VFn9X/opHrwsuiRHJe58M2 QQWuJHCJ2Ne1Lqq5X9TpAQ4ljjGgB8BllvA4FBLzoYcYGSAwMR8uD5m2CFg2vvhuGgTP +E9oX3KMPhFqNaGr97yo1/HNpEr4tV1rDamkbcs2hjhAJrFOGk13bamsDjo2GiJ8M6GL /hQgcpUGbjbMyWObtvJ1C8Ytq83L/HI99JFn2Nt0DFWl/11EYvEGO46ApNp+S6pVTIb4 J0ZYcAsql1H8kaUbifedpMC6Riz0mfn9fCSKo+CPns+DRPnPUKgaDfGTE9TabcghbC7r eCuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330836; x=1739935636; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tTlfV8sxLAVM5HmOqiScCyvjUdi07C2Elp61HaMzN3c=; b=V+1Vm2RWianPC8zv92eJ1nZeM96+Ul5cM7Aq0VTpZhKE72qJKusFm/djA0qlsHJnTK RvNBdtaGAgTRCJzES4JFsNlngAX2giZKZzThpVIYgCd5GCmdQxwypdZiQ5G3dKRId/o2 vTgDn4rVCZiFCTbwnDgD1yJYn65p7R5TMHEHj3ZdeUJ3cHhbDZEagjduJGz32LXzrruL 1vvwUlfc++UmKsidv9+YksPD8yA7KQeXU1wLBDS/nc1CA2Sy+5YOFokrZjwldFoKBq27 8G+HbTBz488W9Hud5sLOHgfkPdWxmFd2iH8x7iHr0DBd0PN/Vk0S23rJWZ6pLEcXpNhb W9UQ== X-Forwarded-Encrypted: i=1; AJvYcCWQIQyWNs3CXSJuXpqNcaR8PlMewWdhQk/sykEIbJtq42DVhsDg7SUBkfGaIkmKYhCv5IA=@vger.kernel.org X-Gm-Message-State: AOJu0YwcwvBrh25XIHD0Oxx0LQdG5CBsQVvS1BttdzW9kwjl/q9MMuRh HHQc1lTB2fJtV4fH2C638e9zwsaB77OgLwd/5Qo+yezvLjUEVgiFumeQ2LPOZGQ= X-Gm-Gg: ASbGncuT87ufYBs1HCak31O2d3ydxXO+ELgAve/oXiisEkR5BqrtchJ6yN0J+lBiG4A rDTIxN369II8MfyWFVaUdoZVvIUDbY3eDuWE4Yellb81nNLpcjUv27BPVN29OfDX19fP1MpYxVX 8HiHH35bwKEbZfCsxE7Kw9JPcHtvqM3HdVspFj30YZRPv3LHg/iioY0955O3svRtZyx1/MEsdiv CoYGfm0OB6yc1w++bd147ZQsemERVQjre5qtOM6DWHJJR293gu6/4sZAwxrT3OgaaTsFgoEnNka BF7yXesmaNRhZsSt7ol7NewKj5/beN7eGCtzMLk= X-Google-Smtp-Source: AGHT+IHgG+cqhHLTM5GhL+QCiY9lQGQ2IdfwmRDB5WhiuGHnCCHz5+WA+EQ57NRlEGqlsXw2RJZzZg== X-Received: by 2002:a05:6a00:841:b0:730:957d:a80f with SMTP id d2e1a72fcca58-7322c3752famr2437374b3a.2.1739330836310; Tue, 11 Feb 2025 19:27:16 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:15 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 03/10] diff: short help: Correct -S description Date: Tue, 11 Feb 2025 19:26:47 -0800 Message-ID: <20250212032657.1807939-4-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 `-S` shows changes that modify the number of occurrences of the specified string, rather than only those that either completely remove it or add it for the first time. --- diff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff.h b/diff.h index 0a566f..49ece3 100644 --- a/diff.h +++ b/diff.h @@ -606,7 +606,7 @@ void diffcore_fix_diff_index(void); " try unchanged files as candidate for copy detection.\n" \ " -l limit rename attempts up to paths.\n" \ " -O reorder diffs according to the .\n" \ -" -S find filepair whose only one side contains the string.\n" \ +" -S find filepair who differ in the number of occurrences of string.\n" \ " --pickaxe-all\n" \ " show all files diff when -S is used and hit is found.\n" \ " -a --text treat all files as text.\n" From patchwork Wed Feb 12 03:26:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971082 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 371D71DC985 for ; Wed, 12 Feb 2025 03:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330839; cv=none; b=b4Q44xRqZ+ggpZrzhLauymK6Alh1DR6IXAi2dhbK/KZsSnsW/Gdwjcyt/pHMcYBnu2Xh9D17aPqysvGcq0flnymbgiGF5KzJ0Iay35ekP4teV67itozdYZFHFLCNthYgHBD7LdmexYCdEBGVueHZEHY+7xeRR+Tt2tMlARI1c+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330839; c=relaxed/simple; bh=QO444lh6UAGvQI8NufzeyhxcB7Tn6BILaTBGCxPQnRo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aA6BhBSBIp10O8IcxkUJZCbvwkFs5PIVBOvt/mfMsZD0d5A2l45oxfgo4Jmk3Sgw5fpqj9j5Lj8OJsm/KuhMKJjfElApygEUUW1R2Xl3tNrySDPq1h447Brg/no2Axx64OUdtFQnYx0yBhZcBZbp+I9UKZlwWjBnw3xmVPLnazA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QQrGgoGV; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QQrGgoGV" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2fa21145217so10114656a91.3 for ; Tue, 11 Feb 2025 19:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330837; x=1739935637; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=57U1MVJyFXhBLaUB6ZU7XT27Jt1zemFZbnQqBPCbRSA=; b=QQrGgoGVZ3/1rO6GuzX3+l+mAzQ+sQEpbMIRkYqCCVtkNHi5iy8FQm8cu1AeN6VyCy bd+BTdsVxnXqLeQOtZcPPCpuOImcPvweEXThzQI+Cq6PDQK768LRHrRyZAvkOYp5Vh/S 9iFIoRNWQVSqLr4LkCWD5DXiwRB6myh+ao6T35Uqo0lGqeI3XH/0+z/BDcQekLDsHcG4 t2iAR4OyQWHyFhVmsdr1dWR9F5E1+bTn7iMq/s6zD+gsTu2kUR2A/M5VjC9acEtC24wi 9BOfEIwQzLfhCoyJdIwrrtsX33uYf5Y5iiJAmj5z/0dtrL5/UdBhVAyJ+4xAvX8xL9LM jnhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330837; x=1739935637; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=57U1MVJyFXhBLaUB6ZU7XT27Jt1zemFZbnQqBPCbRSA=; b=FTarkNXsidn36WzK0/gupmO0TgM1WMlXYLIF3QAOJU7q4GxQkK26U7eE5kEU6ImhY9 KUkH6RBleTXKG7icly/3GLasLq8OT+ONGWZbbC+PRMJDhZvTehVOvX4laBGqumb271Hc vt1Rpy5fWCpnj4N+Z+PWKL6ox781rkODgvtCD3IcYDmvnZ1yF6HsY5DAv39kc1bp3hvp Qis/o1hWPARZbqrkE5hD82FXk+kbfW15oQ/4ZDfpjtmTINLv8t+ULbCqg8Q6+gMOOfWR 4SCkwX6wZ864tI0Wv9AN4tx5dRkQs1NyqHaHUwYIl1mXxT20/9obiTuEXtV7Z11jZ1z4 i2yw== X-Forwarded-Encrypted: i=1; AJvYcCXcaEaIXWJku9Z3N6hjMkAZLOhqhwRi4COLDlv2xMcZPeJ6AbWXD2qaD9TLwlzZCQanynk=@vger.kernel.org X-Gm-Message-State: AOJu0YxPXmvz4Q79ElbNv0mERt/Cja0QlHWdOoLai9PeJ9/eF0UMusS5 YiPQznzeJGtQXxrfA3DhFzpSMQENzeuQu2FD0+u37s9QZq2+8LVF X-Gm-Gg: ASbGncs/ag7oBNayL1B3NAryid+UdLtvQV1iIN/Kbh9p761UrsT9lyt1nUxmtYqNEiM MHEys23kJ3WEPOp95i1gAxSSeBFYQRZGOET488ddGZJjD86nIg9Z9PuVepCZH3TGzHGSkoVPaI8 ySi4MzpFBom0C2p05ZXhUr+XK7aCEKDXqowL5HIQB9gEfAxOZ93eM10K0x4iKu2bvSD24A6Zfxf KcB6AqN7NAA20fqn+yl6gRO53N4Bt5MrSwRSe6NeJVAoxHqghGPC+Gw7DvAeh5DuGfrgxrU7z7W N04FltWvvSsDYcnJpQvE/6okOtOawqIQrxDwH+4= X-Google-Smtp-Source: AGHT+IF8rvxC17BjoptkTCx0jiPHCwbkh+NZID4xOyxHBkuqq1rFBhEi66t24AxpJcq7yMu64gC0tA== X-Received: by 2002:a05:6a00:4650:b0:72d:80da:aff with SMTP id d2e1a72fcca58-7322c37ebbbmr2084217b3a.9.1739330837308; Tue, 11 Feb 2025 19:27:17 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:16 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 04/10] diff: short help: Add -G and --pickaxe-grep Date: Tue, 11 Feb 2025 19:26:48 -0800 Message-ID: <20250212032657.1807939-5-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 -G and --pickaxe-grep seems to be on par with -S and --pickaxe-all that are already mentioned. --- diff.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diff.h b/diff.h index 49ece3..787bb 100644 --- a/diff.h +++ b/diff.h @@ -606,9 +606,12 @@ void diffcore_fix_diff_index(void); " try unchanged files as candidate for copy detection.\n" \ " -l limit rename attempts up to paths.\n" \ " -O reorder diffs according to the .\n" \ +" -G find differences where patch contains the specified regex.\n" \ " -S find filepair who differ in the number of occurrences of string.\n" \ +" --pickaxe-grep\n" \ +" treat as a regex in the -S argument.\n" \ " --pickaxe-all\n" \ -" show all files diff when -S is used and hit is found.\n" \ +" show all files diff when -G or -S is used and hit is found.\n" \ " -a --text treat all files as text.\n" int diff_queue_is_empty(struct diff_options *o); From patchwork Wed Feb 12 03:26:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971084 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 499DF1D95A9 for ; Wed, 12 Feb 2025 03:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330840; cv=none; b=s1ScwVE8+mlWSIhveg4DpFQVCWHrv3Ul/kjdQ5BHC6ifmcGpiSS6LZy5gTnFAteLNglwlXVnOWdLUhHAp1UQpZEgeLcJgixZsSloLmCev6CC8BsfGSrI0xYxXnUOGw8/W/jUZXUGN1awLh2LnKhmLRYu2lSzBSRfkcJrolGqY1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330840; c=relaxed/simple; bh=mtsNSN5mfDYYaqZ3nmqEfQffc7xHoMJXB1mAp0k6f8o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TnmfsbBMguFQvFmtIrGBEz6au1uMsNG9x06FJtFzJIemTLJpuVhDadoa1bxYGzrpx8eVJ+a/ik1pOOySwyHyIm86zI/6Fdv758tsNbLhMmkdY7OHj4onCM8K7Igc0Yxp2bhDAq/QUCO4RHv8cFRj3muyxccLlLvk2bqPQKJFXPU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dg7hGhbB; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dg7hGhbB" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2fa1fb3c445so8052547a91.2 for ; Tue, 11 Feb 2025 19:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330838; x=1739935638; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DgGQrHozVkbJbzXm5nkKPVos1QrnOlRPsjseyUohAow=; b=dg7hGhbB4sKi8Uq7DNkLg59RrDz3xPqHul2yj7jgCu6exe5FvauM2TF+tm46T3wklN axmFPH2SGIivBNIm6e7SCeZz8pWrbENHBxWlg5HLZ6BA6LbgPu3Denmoj/JQSz0GY7bk K13H1z8s+tmBXSVJUTuNu0hmOdkRWaowoaxd5BCfk59lCyOTvcMkEM3xriuuQcjks8h2 pLoBLnd2yDcwo5RMMydLiBHjfbL6eOQj7j0h4KpRYA5lTE5hFOPTeDhb6itENLco2BgX AmqlvGWqGdoEgz5sa/UT8aH5yu6aDDd0tBNCOFLXDXmJ77J2z/apS3QI4PHEdo/O50kI C9NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330838; x=1739935638; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DgGQrHozVkbJbzXm5nkKPVos1QrnOlRPsjseyUohAow=; b=FJPAX8Gx8ZwtevYXjY3KtSJmh8jl0U2wiKm+hlXlvKEzbxnDJWsx6irQ6qSe0TwraE AbZX0H6w5XEPoE8+KBM7Ri0HrlAAw5381LyIiQI9MAOoHJ2oZPmI9qoiOvXH5Me3MNx1 n0+FMtqqRoXwAjsL6/2Kob5gVmOGLNE/vhRRK5PunJqzb5SizudGbyltjsQOSNDJiEBg G2vJU3GFyMJLrQsywuquZS0GCRraj6V/32LmJUz7zaLWw29bQnJeAAcrg2qqstkgYsy4 gbc9ErLYwLtAv43mGOBNlY2H1Od11fUaV1crQIe7+ukcR7p1PPufztQBCviy4WfO9qe1 ISqA== X-Forwarded-Encrypted: i=1; AJvYcCViOIhyzi65Ze0zdrFut5G3HRNhL+tNZLP2aGF5GQ7p1uihi/GbjeXOnT79qBO81MiuLX0=@vger.kernel.org X-Gm-Message-State: AOJu0YwqyEap6UjTLod8M9/b+h1esEf2sZfPbxA4O6u5Q/dfrBbmbkoS IQVEi64aGAn3vmlBccZhpbM0Upkyrmstz0EPgs2TB5F3hjjOAx3b X-Gm-Gg: ASbGncug62t8KkaqVgLaurk/GCY16mAFG/bqVD0naYnv8BMpOHqb4I37V0xq/21UbXY yHJ9TG1odcxlszwa7zO8I7mvclDfGyafoS2oP/kr710OlbqHVE95CDCtcNpNVvH4p9ZnWHE9pNL SYhX3IgOZOsjTYYeLgtHFPjGI669y627YE0ddgVkbxOkNsTAYrzZ7d5Tno2Dd8TE7pggb1wuMwx cGvGIqY/Vvb7CVuJPEmHVbODV14Nwyg8pCw1ZS/jXAMhYr7ZhihifQR4YjmWMxe3N+714cOqYCB /jNKS/MIFbCPSFt1En8yhTiZG3XlpxQC3RvubOY= X-Google-Smtp-Source: AGHT+IGFwFlocDN++utcKjT4V0RLClYS9XfKv3e06Q3xkLCwkMP8DRICyVXbME2La23mPt/KSGRArw== X-Received: by 2002:a05:6a00:1c8e:b0:730:9659:ff4b with SMTP id d2e1a72fcca58-7322c5febedmr2663923b3a.19.1739330838411; Tue, 11 Feb 2025 19:27:18 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:17 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 05/10] docs: gitdiffcore: -G and -S: Use regex/string placeholders Date: Tue, 11 Feb 2025 19:26:49 -0800 Message-ID: <20250212032657.1807939-6-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In the rest of the documentation (and in the code) we use `regex` and `string` as `-G` and `-S` argument placeholders. While `regular-expression` and `block-of-text` are a bit easier to read, it is a bit consistent. And we could assume that everyone who uses git should be able to understand that a "string" and a "block-of-text", as well as a "regex" and "regular-expression" are the same thing. So, using a shorter version is also more consistent. --- Documentation/gitdiffcore.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt index 642c5..0d7d66 100644 --- a/Documentation/gitdiffcore.txt +++ b/Documentation/gitdiffcore.txt @@ -245,26 +245,25 @@ diffcore-pickaxe: For Detecting Addition/Deletion of Specified String This transformation limits the set of filepairs to those that change specified strings between the preimage and the postimage in a certain -way. -S and -G options are used to -specify different ways these strings are sought. +way. `-S` and `-G` options are used to specify +different ways these strings are sought. -"-S" detects filepairs whose preimage and postimage -have different number of occurrences of the specified block of text. +`-S` detects filepairs whose preimage and postimage +have different number of occurrences of the specified __. By definition, it will not detect in-file moves. Also, when a changeset moves a file wholesale without affecting the interesting string, diffcore-rename kicks in as usual, and `-S` omits the filepair (since the number of occurrences of that string didn't change in that rename-detected filepair). When used with `--pickaxe-regex`, treat -the as an extended POSIX regular expression to match, +the __ as an extended POSIX regular expression to match, instead of a literal string. -"-G" (mnemonic: grep) detects filepairs whose -textual diff has an added or a deleted line that matches the given -regular expression. This means that it will detect in-file (or what -rename-detection considers the same file) moves, which is noise. The -implementation runs diff twice and greps, and this can be quite -expensive. To speed things up, binary files without textconv filters -will be ignored. +`-G` (mnemonic: grep) detects filepairs whose textual diff has +an added or a deleted line that matches the given __. This +means that it will detect in-file (or what rename-detection considers +the same file) moves, which is noise. The implementation runs diff +twice and greps, and this can be quite expensive. To speed things up, +binary files without textconv filters will be ignored. When `-S` or `-G` are used without `--pickaxe-all`, only filepairs that match their respective criterion are kept in the output. When From patchwork Wed Feb 12 03:26:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971085 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 863B71DED47 for ; Wed, 12 Feb 2025 03:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330842; cv=none; b=GUDjPMtDBYYmskavsehDh6jlaXJCQGfDst3b+fkJoUviBPvxGr0fJ/GUpxxMrlxkIgAx7Xy01fCLEBmLyXvCB4xQXXaMPJJI54XChe2kcQnw1UU5lJYw68euXJ0zv+7poUl9DUlE5EPlOWKFbC3O1cByg0Pcg/iHkN9aKRGFFYg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330842; c=relaxed/simple; bh=28IzWsWn7PsJXZb78l3jLfm8gf/S4/HRZazYxiTSX18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MIKpxkMLJzWBtXEPhEeWMdLIshLGtzUsK5xNDl61VkTgPmQXrouaAc/xaOFP3f5UlZ5ViEW8jRkI4gYgkyVfjrk3GjAHc9OOZWeshgjYryXfoAAh42SN9QUQKQOFJLcmgScdM8rznRNxbxGhVJksKtbOosW+GjgMZPRNfmAHyEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GrW+nC8q; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GrW+nC8q" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-21f6d264221so47666425ad.1 for ; Tue, 11 Feb 2025 19:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330840; x=1739935640; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Erv8a5fqvim9awrB1iO+/Ads0N6mWJlJ1qKWl3/7hU0=; b=GrW+nC8q1nN5IdDQBzjZIUsJa+pjB0tOfKFHwOk5AUTuuihzFaUc0z3Ii5oztI7R2E No9WOBVZyM1U1PXkzWwBrWAjmyTetI5g2hEhKOKQxZ+pw9e/AiUxU/jSuXSCC5Xjb/Xd eRGW6JMC+WEV0u6e3MiY49G8gAPG5qfOjS//CXCZ2S8C8zAxgsMm53Ha0IJb+asQZyka 4js2ZEM64oFYMwau41SM9L04yoUdCpAla+R172seTUHy4Ep1qjz8xwEis6d8NFGbJHDW kqTthCD6Iz/rS+9JcFVKg5OsOkVI0CDprZDbPYJikAsfW7tRhtWUR1Bq9OdL4G/rC8Cd xjpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330840; x=1739935640; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Erv8a5fqvim9awrB1iO+/Ads0N6mWJlJ1qKWl3/7hU0=; b=toN+kjqMLU78HpL2aeZdIV+gOaY3yrOSqOIKFVKeOcaVUzPvoN+o0RRRPPGt4nl74r Um9y2rSRSAzOEMyrX10CH2bf5OEfxrijJJLiBN1PO9PR97E0GYDgVfdC62EkyerfblR/ pM6j5JNSNZdWDN25IElgIiNtCtO2mF2ievSVq8ONpwf+Xroq76WzRtk9J7v+CDhSOld7 StefXt9avWRj84rNBFEla4doqqtD74zTnmaS9dSDVh6WZH/q67D882+wEf+GrfJuGxIU Q1vXhEx9slgW0TROBk+UOvmGwr5m0ss5VR8At70Tb2XAIHq5x6AdnkVm0NOcprXEwsAw yySA== X-Forwarded-Encrypted: i=1; AJvYcCXXLO+xo5LRSp/83NtW4y7OQ3EDRAhPQpK+kYqldTF+01ytnG5lR+oH8LgiG8SQZV7115w=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9XPICbz1MhBwHtPAX4hsksbJXxbnAUaJ39DY6o9uCS8EOxJcv ynVO6X0YEfJHhv/5aTgtiS51Zn1r250qtmeBqwYC4xMhj5BXamDS X-Gm-Gg: ASbGncu3TTM70pY9rQrlKhM2MnCx8mQeaIYwTDBSjI0K3ru4UmCIfXUubokN2WKGhM8 yE54kmvhHI5zO84jzCYEKlDTBbYlio7loi6b3TkbkITGFIobhV0otcAzi6T7lljhWfWopnpiUsS Jq8e/4SsGAXyH5ouvk8cixOreWL649nTpOLIJGdHqv6iALfWhNxgBgJv1nyKDTR5GEbjrQdhYdB IUG3nL5fMSiR91hjOXusdwAgroJuazrE6DWG39AA9olfy0C+UM4z8xqAC12dyGmrXu9FyzjQa/W wIhv1OGabNpob0twtlP8smbEaUofWmhaORTtu/8= X-Google-Smtp-Source: AGHT+IH3v8ESwdNyoBTIiXjpUGwmJi7TmwonMGMoXJtU6aPRXSlqip9nij6JECUkHH7E/9+Ua7fqpg== X-Received: by 2002:a05:6a00:3283:b0:730:949d:2d3f with SMTP id d2e1a72fcca58-7322c388652mr1962883b3a.7.1739330839759; Tue, 11 Feb 2025 19:27:19 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:19 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 06/10] diff: --patch-{grep,modifies} arg names for -G and -S Date: Tue, 11 Feb 2025 19:26:50 -0800 Message-ID: <20250212032657.1807939-7-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Most arguments have both short and long versions. Long versions are easier to read, especially in scripts and command history. This change mostly keeps existing uses of -G and -S as is in the tests, documentation and help output. Tests that check just the option parsing are duplicated to check both short and long argument options. Signed-off-by: Illia Bobyr --- Documentation/diff-options.txt | 2 ++ Documentation/gitdiffcore.txt | 3 ++- diff.c | 12 ++++++---- diff.h | 8 +++++-- t/t4209-log-pickaxe.sh | 42 ++++++++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 8 deletions(-) diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 640eb..07413d 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -650,6 +650,7 @@ Note that not all diffs can feature all types. For instance, copied and renamed entries cannot appear if detection for those types is disabled. `-S`:: +`--patch-modifies=`:: Look for differences that change the number of occurrences of the specified __ (i.e. addition/deletion) in a file. Intended for the scripter's use. @@ -663,6 +664,7 @@ very first version of the block. Binary files are searched as well. `-G`:: +`--patch-grep=`:: Look for differences whose patch text contains added/removed lines that match __. + diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt index 0d7d66..e934b9 100644 --- a/Documentation/gitdiffcore.txt +++ b/Documentation/gitdiffcore.txt @@ -245,7 +245,8 @@ diffcore-pickaxe: For Detecting Addition/Deletion of Specified String This transformation limits the set of filepairs to those that change specified strings between the preimage and the postimage in a certain -way. `-S` and `-G` options are used to specify +way. `--patch-modifies=` (`-S` for short) and +`--patch-grep=` (`-G` for short) are used to specify different ways these strings are sought. `-S` detects filepairs whose preimage and postimage diff --git a/diff.c b/diff.c index bd9db..ac2cd 100644 --- a/diff.c +++ b/diff.c @@ -4877,15 +4877,17 @@ void diff_setup_done(struct diff_options *options) if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK)) die(_("options '%s', '%s', and '%s' cannot be used together"), - "-G", "-S", "--find-object"); + "-G/--patch-grep", "-S/--patch-modifies", "--find-object"); if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK)) die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s'"), - "-G", "--pickaxe-regex", "--pickaxe-regex", "-S"); + "-G/--patch-grep", "--pickaxe-regex", + "--pickaxe-regex", "-S/--patch-modifies"); if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_ALL_OBJFIND_MASK)) die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"), - "--pickaxe-all", "--find-object", "--pickaxe-all", "-G", "-S"); + "--pickaxe-all", "--find-object", + "--pickaxe-all", "-G/--patch-grep", "-S/--patch-modifies"); /* * Most of the time we can say "there are changes" @@ -5862,10 +5864,10 @@ struct option *add_diff_options(const struct option *opts, OPT_SET_INT_F(0, "ita-visible-in-index", &options->ita_invisible_in_index, N_("treat 'git add -N' entries as real in the index"), 0, PARSE_OPT_NONEG), - OPT_CALLBACK_F('S', NULL, options, N_(""), + OPT_CALLBACK_F('S', "patch-modifies", options, N_(""), N_("look for differences that change the number of occurrences of the specified string"), 0, diff_opt_pickaxe_string), - OPT_CALLBACK_F('G', NULL, options, N_(""), + OPT_CALLBACK_F('G', "patch-grep", options, N_(""), N_("look for differences where a patch contains the specified regex"), 0, diff_opt_pickaxe_regex), OPT_BIT_F(0, "pickaxe-all", &options->pickaxe_opts, diff --git a/diff.h b/diff.h index 787bb..ed48a 100644 --- a/diff.h +++ b/diff.h @@ -606,8 +606,12 @@ void diffcore_fix_diff_index(void); " try unchanged files as candidate for copy detection.\n" \ " -l limit rename attempts up to paths.\n" \ " -O reorder diffs according to the .\n" \ -" -G find differences where patch contains the specified regex.\n" \ -" -S find filepair who differ in the number of occurrences of string.\n" \ +" -G\n" \ +" --patch-grep=\n" \ +" find differences where patch contains the regex.\n" \ +" -S\n" \ +" --patch-modifies=\n" \ +" find filepair who differ in the number of occurrences of string.\n" \ " --pickaxe-grep\n" \ " treat as a regex in the -S argument.\n" \ " --pickaxe-all\n" \ diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh index ed70c..ab14b 100755 --- a/t/t4209-log-pickaxe.sh +++ b/t/t4209-log-pickaxe.sh @@ -60,24 +60,48 @@ test_expect_success 'usage' ' test_expect_code 129 git log -S 2>err && test_grep "switch.*requires a value" err && + test_expect_code 129 git log --patch-modifies 2>err && + test_grep "option.*requires a value" err && + test_expect_code 129 git log -G 2>err && test_grep "switch.*requires a value" err && + test_expect_code 129 git log --patch-grep 2>err && + test_grep "option.*requires a value" err && + test_expect_code 128 git log -Gregex -Sstring 2>err && grep "cannot be used together" err && + test_expect_code 128 git log -Gregex --patch-modifies string 2>err && + grep "cannot be used together" err && + + test_expect_code 128 git log --patch-grep regex -Sstring 2>err && + grep "cannot be used together" err && + + test_expect_code 128 git log --patch-grep regex --patch-modifies string 2>err && + grep "cannot be used together" err && + test_expect_code 128 git log -Gregex --find-object=HEAD 2>err && grep "cannot be used together" err && + test_expect_code 128 git log --patch-grep regex --find-object=HEAD 2>err && + grep "cannot be used together" err && + test_expect_code 128 git log -Sstring --find-object=HEAD 2>err && grep "cannot be used together" err && + test_expect_code 128 git log --patch-modifies string --find-object=HEAD 2>err && + grep "cannot be used together" err && + test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err && grep "cannot be used together" err ' test_expect_success 'usage: --pickaxe-regex' ' test_expect_code 128 git log -Gregex --pickaxe-regex 2>err && + grep "cannot be used together" err && + + test_expect_code 128 git log --patch-grep regex --pickaxe-regex 2>err && grep "cannot be used together" err ' @@ -89,7 +113,13 @@ test_expect_success 'usage: --no-pickaxe-regex' ' test_expect_code 128 git log -Sstring --no-pickaxe-regex 2>actual && test_cmp expect actual && + test_expect_code 128 git log --patch-modifies string --no-pickaxe-regex 2>actual && + test_cmp expect actual && + test_expect_code 128 git log -Gregex --no-pickaxe-regex 2>err && + test_cmp expect actual && + + test_expect_code 128 git log --patch-grep regex --no-pickaxe-regex 2>err && test_cmp expect actual ' @@ -104,9 +134,13 @@ test_log_icase expect_second --author person test_log_icase expect_nomatch --author spreon test_log expect_nomatch -G picked +test_log expect_nomatch --patch-grep picked test_log expect_second -G Picked +test_log expect_second --patch-grep Picked test_log_icase expect_nomatch -G pickle +test_log_icase expect_nomatch --patch-grep pickle test_log_icase expect_second -G picked +test_log_icase expect_second --patch-grep picked test_expect_success 'log -G --textconv (missing textconv tool)' ' echo "* diff=test" >.gitattributes && @@ -122,14 +156,22 @@ test_expect_success 'log -G --no-textconv (missing textconv tool)' ' ' test_log expect_nomatch -S picked +test_log expect_nomatch --patch-modifies picked test_log expect_second -S Picked +test_log expect_second --patch-modifies Picked test_log_icase expect_second -S picked +test_log_icase expect_second --patch-modifies picked test_log_icase expect_nomatch -S pickle +test_log_icase expect_nomatch --patch-modifies pickle test_log expect_nomatch -S p.cked --pickaxe-regex +test_log expect_nomatch --patch-modifies p.cked --pickaxe-regex test_log expect_second -S P.cked --pickaxe-regex +test_log expect_second --patch-modifies P.cked --pickaxe-regex test_log_icase expect_second -S p.cked --pickaxe-regex +test_log_icase expect_second --patch-modifies p.cked --pickaxe-regex test_log_icase expect_nomatch -S p.ckle --pickaxe-regex +test_log_icase expect_nomatch --patch-modifies p.ckle --pickaxe-regex test_expect_success 'log -S --textconv (missing textconv tool)' ' echo "* diff=test" >.gitattributes && From patchwork Wed Feb 12 03:26:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971086 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0ECD81DB154 for ; Wed, 12 Feb 2025 03:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330843; cv=none; b=Lr/8zpWD5p0/AL/ySp9kScAfY8foGTL0UgLMvFUlVK9mJ55+RjQssSJ+xfNHTuJU5LYDhnmSFcF1YmVedcFQ5UHYLWP2FrcoCLWKwTbRmoPUKdf7kgz5fGxGHWr7hiyOyhGsvJj7a5gLIm2yQpjzc6kNHD1acm9XzlU9kzj5oC8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330843; c=relaxed/simple; bh=sA2Fl6EaZ/yJyhqVWnSlz2kiXbSnEIokifLfU1UBcuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ag5ZnzopDfkPFnv40zk4o3bgP2Jj3huue1dIQ8xB/VSYAuGyDtI3AYKTrVV1u7DhFpKMwJpfBUt7nehu4Yu7P06tNa/FWBGyflaoVMKH4/oJW7JU5ket6n3vJ6KazlEG1b+77XYNhRGY4LBHD0Q340JQUpvimhs0KYZVjWkfGDU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bIM1P4Y9; arc=none smtp.client-ip=209.85.216.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bIM1P4Y9" Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2fa51743d80so5434481a91.2 for ; Tue, 11 Feb 2025 19:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330841; x=1739935641; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oShxNFBA2whHNuM0znTUdxztBoBluLeuiQwSYo49ZOQ=; b=bIM1P4Y9cGEqBB1CxUC0POHWD5t0MkRrOpg1j8RT1lOcxO9cOK2HQLk1zCFunVfo7a ZzC/oMPMB+lXqs22v2YR07r+7S882KS6HkowDhgmiTlbcWS6XiwkA3M9wSacAKDeEE0w fNg16RiD6AInpsPy6WI1MIWLM6IWAEOxNS5fDCsfYIPtCI458Uz+AucGulQOX0jRPTI5 vWd5vlB5N/ew7gUxaEj1IsGGSan1SDI88ekU7h8DVYxz616r+/hG+hmpWE5gKGsMvnq7 LVCWk/HkR4AfOS5vAxD4OOi8wbUqC7IhZLMb4xj7d5mAeBsluMr1NzyElWKaI1RUK08/ mkaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330841; x=1739935641; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oShxNFBA2whHNuM0znTUdxztBoBluLeuiQwSYo49ZOQ=; b=mB7CUMs1/IXniMT/W38/JM8hRvNjEgfIhwHefq+a6mIg0PVDpGAxIR6kQ7Bnnl2R89 fpEGe5iTaX1hcyKdRm6SbuxlvC6Kt6DmrZEEOzrR+rYHwtfznDv5baOuLeSnKPsTvBZh 8UiPplebLO0afrvbzqDjZmGqyTwgFqs00rTV54LP2pT76q0/a7BrCZzvilBQ43bg0DUS Y0N0AW1GDbvESFlCfwn0Rv6AOGSaVG0YwxNYoJCW1b4DFKqNKpkQJXPVOX43gIZdy07T ajMXbMCFxuHXNIQEMHZan1Ggh83T1QZP0vx9jcZ/E8X0xDHEWVFqOEkV4uKGKkzYm+g1 956w== X-Forwarded-Encrypted: i=1; AJvYcCV2okToigSH38k4xg6cfHLxH4yFBwzaEbqghBKfG2Q6oUFtw1lTG99I3EMh4kKHYuia8N0=@vger.kernel.org X-Gm-Message-State: AOJu0YzUvr7rXJyWk3xrOhm/UTLCm0rn/f3abF2h0EkmjyNrS1Nbps53 MvKM6hs2PT2J60bicRwArJnqEJ77RvwrBcel5wALJzKi/37YaXn4 X-Gm-Gg: ASbGnctmecioAomiwKkAEOydveL5qYIlESbof8DfrUt3+Pzf6p1mc2a0NgRYw9UPWLx O8fUGGLCYDrhpFUtAarrxkMYRMIJBfMrkCgMy2uPmp4oq8iJDgrKuRmbUFHSp8+nHbyQRCfPn9j ipSB0DNpwMxOFM8XBr9YhLB9zfzXwg01d0h+xvSbpXNjR2SZ+2P+l3WzCpiP5NucttrGsVZUuib V5q05uK0Ipfth6usywUwLk69Z1Eo8rzJj5R8cT3Mu5TB0BgEvrZiXJfMFOokk775euCuxpVKifM CiFVyhrfPKt/mqOJ6T5D2xWjR5d2NcwL6chzrtU= X-Google-Smtp-Source: AGHT+IE3NqvCAA6xeQ4EYVYxr7zJtQrY5SIjErltw2xXnScnUSHmK/5N1NU3dW0DNQGuAqmbRSP4jg== X-Received: by 2002:a05:6a00:181a:b0:732:1840:8389 with SMTP id d2e1a72fcca58-7322c0a0194mr2425171b3a.0.1739330841077; Tue, 11 Feb 2025 19:27:21 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:20 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 07/10] completion: Support --patch-{grep,modifies} Date: Tue, 11 Feb 2025 19:26:51 -0800 Message-ID: <20250212032657.1807939-8-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- contrib/completion/git-completion.bash | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 41391..daf335 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1900,6 +1900,7 @@ __git_diff_common_options="--stat --numstat --shortstat --summary --output= --output-indicator-context= --output-indicator-new= --output-indicator-old= --ws-error-highlight= + --patch-grep= --patch-modifies= --pickaxe-all --pickaxe-regex --patch-with-raw " @@ -2216,7 +2217,7 @@ __git_complete_log_opts () __git_complete_symbol --cur="${cur#:}" --sfx=":" return ;; - -G,*|-S,*) + -G,*|--patch-grep,*|-S,*|--patch-modifies,*) __git_complete_symbol return ;; @@ -2239,6 +2240,14 @@ __git_complete_log_opts () __gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}" return ;; + --patch-grep=*) + __git_complete_symbol --pfx="--patch-grep=" --cur="${cur#--patch-grep=}" + return + ;; + --patch-modifies=*) + __git_complete_symbol --pfx="--patch-modifies=" --cur="${cur#--patch-modifies=}" + return + ;; --submodule=*) __gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}" return From patchwork Wed Feb 12 03:26:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971087 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74BBB1E7C0B for ; Wed, 12 Feb 2025 03:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330845; cv=none; b=ZfE4U/t2IuOWDzqKWuTSK1szaQTSFW2iBE3I7LJtPwBMjT6ngYuQZGzUw631fEwGKtwtCkEM4D6mau1zAN51eMk/f68VU1m5Pu0MHGKjqvk79wMlPskFa5nPMSEV2ovF3/+ob4i2sO1IV7bUN9ZoIyzsD6vqqJYiqIda5diqhco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330845; c=relaxed/simple; bh=1k6sZFd5SlI1tRrsIV2iTwLP+8Q3ipcVpAKF+jzh+uQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OYeo9DQE53HQMkxQiUFdvg+2tlxY0ogQr2IoISkjODNLFCLb6Xj9/HTmfquwHsoHHbtjaaT6bVWpUbhgZtkQs08IRYYbhGjNuJos2hHqID3Gha14uUMkOwKM9Qr15Zn8w4SiHYmxBOO3XcK2EdAjMfDEXFZaZFXYgJXfOs+P7NA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ae92/Vqu; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ae92/Vqu" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-21f62cc4088so76171905ad.3 for ; Tue, 11 Feb 2025 19:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330843; x=1739935643; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8yLM0t6bi/COjCWc8nMIU3KttU+/DAqFPI83g6CJ4i4=; b=Ae92/Vqujx02Z8ocWVE4lRfkyU5CJcObmekNcAUzF062jWhd71xpweLpL1AON7TOM4 rhbhN87WTF1W7iuFB/4aHMK5dILDFz9hTaNE2fi6Qha8fwt/yv8JkzzL1SYESwYxlhAG f2OGdpsCiOLJk9r9T/9Z8Ox47dagKt7JWNniKruRqXdVpnNncG55KicDqwdsFeDKGpF1 g1V2bZ5KZHI0DbuaC1OBeSVUEr0CXuMfmb2t3gctSkoLVMyZGaw12noen+srQyxrr5Ff 5H1/Xg0IY9B7KFecggICSxB8VpMEHzBt2nV6AiX04zqlGHZ8p4vXbMXxdrVPOHQS5jgs LsPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330843; x=1739935643; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8yLM0t6bi/COjCWc8nMIU3KttU+/DAqFPI83g6CJ4i4=; b=R9iV6VqLpGU0ZpWuPnuyHp51W33I9rZGFM30ji5R7zPgKHVZMyJB0DFLPj33trWLX5 HQhCs/4POLOmodWsC/TJVJrmdYj4oeV7dJ+Vid0LbLH+HuHlT8eRbhMyd+1xH6Se3w2y 48zrpOP8jvjAsZcQ/TBvuaL3S946OU4I9GWuZs7Ol3tOIFUNCnRXfqt8IF55ZtkBijUr ronSRStz42vZoLva4QP6XveQwJVgrYvQOXejwA9Vkd9kIOkD5ySHKYscoDI3Cqd8vY6H RxEQzOoIXpiuGuXANGr7aCk+aRrA9FunduBGQzsDJT+k3NYkkL0kNZ5cvQYQyL+YRmPA q3MQ== X-Forwarded-Encrypted: i=1; AJvYcCXV4CgsatyEnvkpoBvLwaypdinutZQV3S8WMGvgKUluZTGNtf3CMkjijfRuiFuwzQPvN0Q=@vger.kernel.org X-Gm-Message-State: AOJu0YyrRkyYlYLPNSBpxNgTuEdSEru6DuPrMYuPz827Z+2QvbROXu2x YJtnXsOK8TCDr4Sw9u7kHtM0sGC9e3/ZJe8XTxAsIpOgzsif/lJuUmG27qTeEVQ= X-Gm-Gg: ASbGncsa9pR4BWr6SrpCKKEeKmlQ5nfEZ9uUGNJFdZjE3q4Q/gP9WPn/ha86h3Nufw0 e2RJRu21j0McBkjLea1jYdy4ODYwhRfDWPMh0OO+mrbw3WcugnsGCxFEqx6hV6BittWGUDkPkUO XDza7C3juEM0+qtUOspRxQHkY0anAPxVFXkxNXOZs4hQQ7gx2psRZaa+9EJILsi/a/chmKupw2f ubcmHEU1EgFhFfQH7bEEfNsNARkcSKDj0MiD+IG1RiJfzT2ZpakSsk/z9J2LM3zkieHzmM0P6Lx INzjRltnKbj/jbo8NwbQn+e52QMm4WlqNPZii1g= X-Google-Smtp-Source: AGHT+IGxvxvChSCF+EodxS7ZWkAiq4e7NNvt2Bn9FEbHB7ZsBeQumRDJ/OV6p/KR8ocv2mkLNjRdSA== X-Received: by 2002:a05:6a00:2e84:b0:730:888a:252e with SMTP id d2e1a72fcca58-7322c411a33mr2355622b3a.17.1739330842570; Tue, 11 Feb 2025 19:27:22 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:21 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 08/10] diff: test: Use --patch-{grep,modifies} over -G/-S Date: Tue, 11 Feb 2025 19:26:52 -0800 Message-ID: <20250212032657.1807939-9-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Long argument names are easier to read, compared to short ones. So while short arguments are great when you want to type a command quickly, tests are more readable if we use long argument names. There are still test that verify that both short and long arguments work interchangeably when parsing the arguments. Tests where the focus is not on the argument names are updated to use long argument names. --- t/t4062-diff-pickaxe.sh | 8 +++--- t/t4209-log-pickaxe.sh | 62 ++++++++++++++++++++--------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/t/t4062-diff-pickaxe.sh b/t/t4062-diff-pickaxe.sh index 8ad3d7..805e0f 100755 --- a/t/t4062-diff-pickaxe.sh +++ b/t/t4062-diff-pickaxe.sh @@ -16,13 +16,13 @@ test_expect_success setup ' ' # OpenBSD only supports up to 255 repetitions, so repeat twice for 64*64=4096. -test_expect_success '-G matches' ' - git diff --name-only -G "^(0{64}){64}$" HEAD^ >out && +test_expect_success '--patch-grep matches' ' + git diff --name-only --patch-grep "^(0{64}){64}$" HEAD^ >out && test 4096-zeroes.txt = "$(cat out)" ' -test_expect_success '-S --pickaxe-regex' ' - git diff --name-only -S0 --pickaxe-regex HEAD^ >out && +test_expect_success '--patch-modifies --pickaxe-regex' ' + git diff --name-only --patch-modifies 0 --pickaxe-regex HEAD^ >out && test 4096-zeroes.txt = "$(cat out)" ' diff --git a/t/t4209-log-pickaxe.sh b/t/t4209-log-pickaxe.sh index ab14b..5f4d6 100755 --- a/t/t4209-log-pickaxe.sh +++ b/t/t4209-log-pickaxe.sh @@ -1,6 +1,6 @@ #!/bin/sh -test_description='log --grep/--author/--regexp-ignore-case/-S/-G' +test_description='log --grep/--author/--regexp-ignore-case/--patch-{modifies,grep}' . ./test-lib.sh @@ -142,15 +142,15 @@ test_log_icase expect_nomatch --patch-grep pickle test_log_icase expect_second -G picked test_log_icase expect_second --patch-grep picked -test_expect_success 'log -G --textconv (missing textconv tool)' ' +test_expect_success 'log --patch-grep --textconv (missing textconv tool)' ' echo "* diff=test" >.gitattributes && - test_must_fail git -c diff.test.textconv=missing log -Gfoo && + test_must_fail git -c diff.test.textconv=missing log --patch-grep foo && rm .gitattributes ' -test_expect_success 'log -G --no-textconv (missing textconv tool)' ' +test_expect_success 'log --patch-grep --no-textconv (missing textconv tool)' ' echo "* diff=test" >.gitattributes && - git -c diff.test.textconv=missing log -Gfoo --no-textconv >actual && + git -c diff.test.textconv=missing log --patch-grep foo --no-textconv >actual && test_cmp expect_nomatch actual && rm .gitattributes ' @@ -173,20 +173,20 @@ test_log_icase expect_second --patch-modifies p.cked --pickaxe-regex test_log_icase expect_nomatch -S p.ckle --pickaxe-regex test_log_icase expect_nomatch --patch-modifies p.ckle --pickaxe-regex -test_expect_success 'log -S --textconv (missing textconv tool)' ' +test_expect_success 'log --patch-modifies --textconv (missing textconv tool)' ' echo "* diff=test" >.gitattributes && - test_must_fail git -c diff.test.textconv=missing log -Sfoo && + test_must_fail git -c diff.test.textconv=missing log --patch-modifies foo && rm .gitattributes ' -test_expect_success 'log -S --no-textconv (missing textconv tool)' ' +test_expect_success 'log --patch-modifies --no-textconv (missing textconv tool)' ' echo "* diff=test" >.gitattributes && - git -c diff.test.textconv=missing log -Sfoo --no-textconv >actual && + git -c diff.test.textconv=missing log --patch-modifies foo --no-textconv >actual && test_cmp expect_nomatch actual && rm .gitattributes ' -test_expect_success 'setup log -[GS] plain & regex' ' +test_expect_success 'setup log --patch{-modifies,-grep} plain & regex' ' test_create_repo GS-plain && test_commit -C GS-plain --append A data.txt "a" && test_commit -C GS-plain --append B data.txt "a a" && @@ -201,31 +201,31 @@ test_expect_success 'setup log -[GS] plain & regex' ' git -C GS-plain log >full-log ' -test_expect_success 'log -G trims diff new/old [-+]' ' - git -C GS-plain log -G"[+-]a" >log && +test_expect_success 'log --patch-grep trims diff new/old [-+]' ' + git -C GS-plain log --patch-grep "[+-]a" >log && test_must_be_empty log && - git -C GS-plain log -G"^a" >log && + git -C GS-plain log --patch-grep "^a" >log && test_cmp log A-to-B-then-E-log ' -test_expect_success 'log -S is not a regex, but -S --pickaxe-regex is' ' - git -C GS-plain log -S"a" >log && +test_expect_success 'log --patch-modifies is not a regex, but --patch-modifies --pickaxe-regex is' ' + git -C GS-plain log --patch-modifies "a" >log && test_cmp log A-to-B-then-E-log && - git -C GS-plain log -S"[a]" >log && + git -C GS-plain log --patch-modifies "[a]" >log && test_must_be_empty log && - git -C GS-plain log -S"[a]" --pickaxe-regex >log && + git -C GS-plain log --patch-modifies "[a]" --pickaxe-regex >log && test_cmp log A-to-B-then-E-log && - git -C GS-plain log -S"[b]" >log && + git -C GS-plain log --patch-modifies "[b]" >log && test_cmp log D-then-E-log && - git -C GS-plain log -S"[b]" --pickaxe-regex >log && + git -C GS-plain log --patch-modifies "[b]" --pickaxe-regex >log && test_cmp log C-to-D-then-E-log ' -test_expect_success 'setup log -[GS] binary & --text' ' +test_expect_success 'setup log --patch{-modifies,-grep} binary & --text' ' test_create_repo GS-bin-txt && test_commit -C GS-bin-txt --printf A data.bin "a\na\0a\n" && test_commit -C GS-bin-txt --append --printf B data.bin "a\na\0a\n" && @@ -233,36 +233,36 @@ test_expect_success 'setup log -[GS] binary & --text' ' git -C GS-bin-txt log >full-log ' -test_expect_success 'log -G ignores binary files' ' - git -C GS-bin-txt log -Ga >log && +test_expect_success 'log --patch-grep ignores binary files' ' + git -C GS-bin-txt log --patch-grep a >log && test_must_be_empty log ' -test_expect_success 'log -G looks into binary files with -a' ' - git -C GS-bin-txt log -a -Ga >log && +test_expect_success 'log --patch-grep looks into binary files with -a' ' + git -C GS-bin-txt log -a --patch-grep a >log && test_cmp log full-log ' -test_expect_success 'log -G looks into binary files with textconv filter' ' +test_expect_success 'log --patch-grep looks into binary files with textconv filter' ' test_when_finished "rm GS-bin-txt/.gitattributes" && ( cd GS-bin-txt && echo "* diff=bin" >.gitattributes && - git -c diff.bin.textconv=cat log -Ga >../log + git -c diff.bin.textconv=cat log --patch-grep a >../log ) && test_cmp log full-log ' -test_expect_success 'log -S looks into binary files' ' - git -C GS-bin-txt log -Sa >log && +test_expect_success 'log --patch-modifies looks into binary files' ' + git -C GS-bin-txt log --patch-modifies a >log && test_cmp log full-log ' -test_expect_success 'log -S --pickaxe-regex looks into binary files' ' - git -C GS-bin-txt log --pickaxe-regex -Sa >log && +test_expect_success 'log --patch-modifies --pickaxe-regex looks into binary files' ' + git -C GS-bin-txt log --pickaxe-regex --patch-modifies a >log && test_cmp log full-log && - git -C GS-bin-txt log --pickaxe-regex -S"[a]" >log && + git -C GS-bin-txt log --pickaxe-regex --patch-modifies "[a]" >log && test_cmp log full-log ' From patchwork Wed Feb 12 03:26:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971088 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DB0D1E5707 for ; Wed, 12 Feb 2025 03:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330846; cv=none; b=r+yAMwRfMQ/G39M7/FDGS98BLkLYO00/1iSxnYFAZXwxRkVikLyJ7Sw5H/3gXWe0HwMRCGb5v4IS+gV9UqCuudUcQGvwz/CI8rOFxNgdxUrZnDEfaV2/75zPcieg1fGG00KabT5p7H7PGBDOBZIhaEnJr4Mb9Yvh7ewYJZZGXa8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330846; c=relaxed/simple; bh=at0aJg0TAgmlpPYtiUNOgwEq/y1ZzMivTl9xaEzT55k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dbMNm6Px2q46SeG4x+H1LVBkUc4CoHlxI2xGS7ilfbryrcwuxI2rDw8pJvXs1cCQ8UUgDEC6R2cWjKyKr8zsHuTKab4274jTz3ENOI+x3ySMX4QcCbVhotfpmTC7sJtydj64spVAOKTdJzVs0+zyk4BKpSuRrQfJASBxRq5oPsY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Tsi2+Dtt; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tsi2+Dtt" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-21f7f1e1194so87917335ad.2 for ; Tue, 11 Feb 2025 19:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330844; x=1739935644; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xWUP9PAoX6nXGAi7BUu9ADVDebYFDrcl3z3wLBs5/5U=; b=Tsi2+Dtt4PW2rsdiiXWKyfv4MwAMQGLeOxebtuhT68TV9pTUZA5iSK1AqQPvw7Rr7D AYVXLU1lV8hfCH0SlpX7uKhZ4AUcDQ2VcmDH8VMDmyuEn73Vo3dSlce22o0Tvm9YbY3g MCT6dryYwQ2kdufwBUoQcIJYbnCIa7ddlzykNj5P1qEOwBLz/FSm1njtP/cYpyjwojVa 6elbjPr6R8DlnRPThyy5tyripLPTeXnBe54O26SSOSOHXJDhdDG3pbbFuu139fHArbsh BcOuJpaQiOcoxxjcsDDsoOCPL8Dan5NVv8JWG21O9HKyIkIRfFpPkSqr7FeJHjWGGIvE VZaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330844; x=1739935644; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xWUP9PAoX6nXGAi7BUu9ADVDebYFDrcl3z3wLBs5/5U=; b=ZJz0btuAzxfExDEcKgXKdJMC1jy9KupGokdRMqRAXsQeMrxLgrj03w9WBntRxybuuk dNaAqi6gP0C1INL/XZRAFhdYniD61oOpffAzF2vQ+C2T9O7qbyCUVERWWLnahUyI5yHu 6cvfFzBST2dRA7WnEMUfzgnAmnljs6voLVijRJ2QWtFSA02JczrEfe4EPIvJ+bEMWAwj hZCCWm5Y9izcNR2i8CwAI8wSd4KsWO9j5iFo7HknA34tesMhxwYF9Iyc1FjXM5ZnXD4l K+81ZKcueCrZLyDZ6y0kpCSaDQX1NSDOvdF6IOh9dx3f8xvMiCZdx8gEROamqxSDAuOE Lhuw== X-Forwarded-Encrypted: i=1; AJvYcCV7WqRyI8V+p8TfjbdYS+MfFCZV66tq9ixPID5LogNwNatuMuOd1uAuiNAfC8IdPpiL7yE=@vger.kernel.org X-Gm-Message-State: AOJu0YytnY5WqcvrF2Gswb+g86sJmUnQFCYb7Da+ZvGadn2oPukt+CPO T8bbXy3UJ+gkzs3aGDmvEaray1P2u+wBGRKIuecx8WfWt5MjIO+B X-Gm-Gg: ASbGncv8Qr5Qd0xclL5UYYLuzohSHGN3Nb/Tl8cFUvM5NIVI5MrP43gBEr++7MIc8co B6/lkjBh6axxzA4rSKUu8QIJAVz0EaxYxvv3nweA6jmxI46seDWAszZrjbH2x3NsLEYUQQcvpS9 84HZzNmzdNZF/HaDMEpLjAthXOMSbKdMhZXGpS5L1WXCr1xI3RvD1XDiW/hKg7jsSuGoqyoc12u mW2TUXQSDGFcdiqF+USdwIkMp4gLA97fFj7CJfBP+kZE5DnzqH0oGKGqu8dmWEnbJIVqvum3oxh soM3PHXDZK+u2I3XTHSQgEhCGuhhJfcRydK4VNs= X-Google-Smtp-Source: AGHT+IGd0T3D63TZzJwDEFcivsCQcNsHbb11zqIRMxqjiXNJxyllfh51kJNC/iv264SGO2XTjSmz4Q== X-Received: by 2002:a05:6300:8a06:b0:1ee:5e64:b17c with SMTP id adf61e73a8af0-1ee5e6509b0mr1668618637.21.1739330843844; Tue, 11 Feb 2025 19:27:23 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:23 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 09/10] diff: --pickaxe-{all,regex} help: Add --patch-{grep,modifies} Date: Tue, 11 Feb 2025 19:26:53 -0800 Message-ID: <20250212032657.1807939-10-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 For less experienced users --patch-{grep,modifies} should be easier to understand than just -S or -G. By mentioning the long argument names in the help messages we save those users from having to search the list of options for an explanation of what -S or -G stand for. --- diff.c | 4 ++-- diff.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/diff.c b/diff.c index ac2cd..a9e78 100644 --- a/diff.c +++ b/diff.c @@ -5871,10 +5871,10 @@ struct option *add_diff_options(const struct option *opts, N_("look for differences where a patch contains the specified regex"), 0, diff_opt_pickaxe_regex), OPT_BIT_F(0, "pickaxe-all", &options->pickaxe_opts, - N_("show all changes in the changeset with -S or -G"), + N_("show all changes in the changeset with -S/--patch-modifies or -G/--patch-grep"), DIFF_PICKAXE_ALL, PARSE_OPT_NONEG), OPT_BIT_F(0, "pickaxe-regex", &options->pickaxe_opts, - N_("treat in -S as extended POSIX regular expression"), + N_("treat in -S/--patch-modifies as extended POSIX regular expression"), DIFF_PICKAXE_REGEX, PARSE_OPT_NONEG), OPT_FILENAME('O', NULL, &options->orderfile, N_("control the order in which files appear in the output")), diff --git a/diff.h b/diff.h index ed48a..9ad37 100644 --- a/diff.h +++ b/diff.h @@ -613,9 +613,9 @@ void diffcore_fix_diff_index(void); " --patch-modifies=\n" \ " find filepair who differ in the number of occurrences of string.\n" \ " --pickaxe-grep\n" \ -" treat as a regex in the -S argument.\n" \ +" treat as a regex in the -S/--patch-modifies argument.\n" \ " --pickaxe-all\n" \ -" show all files diff when -G or -S is used and hit is found.\n" \ +" show all files diff for -G/--patch-grep and -S/--patch-modifies.\n" \ " -a --text treat all files as text.\n" int diff_queue_is_empty(struct diff_options *o); From patchwork Wed Feb 12 03:26:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Illia Bobyr X-Patchwork-Id: 13971089 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A78331E98EA for ; Wed, 12 Feb 2025 03:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330847; cv=none; b=VweGjAGZv8ZHhnQBQwsYxhcyLgbEug4Q5hEjEIZ9EnpfZYq/HzOTiDfV69Gkxi6mXV1vzlmT6wXGIY0gO3fjZ7fB2sBqkk5MlVmNx1/KiWBo5NJaN5i/SiHocj6ze5u9OK1SDY4IuZNSWOrGQZlF+DeCv+lKAdmWLrRA/Mu44v8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739330847; c=relaxed/simple; bh=HcRamvrzcbtIUlzpaFjIKvl79wT8WgDWd1l8byud9Oc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jvfbcCD+vulEk3L1ed0cSYDO4/DmOV7Fmm1ZneBmaw/y+SEZ4SULlHpev0p1RXmS3uu9mBZkSgO1QwN8Xn2r8P8tNL6WYHSRR4JY5aCPDl0Z+skkKbck5xIIynS61UXFqKudi9qzzbJJlxLlBSNqqC5JrYER0cqYknVHKvZkW/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IB9QrjTw; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IB9QrjTw" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-219f8263ae0so112116435ad.0 for ; Tue, 11 Feb 2025 19:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739330845; x=1739935645; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wblqpLdDOzzXtmdXTdBplqjywGYcu1aJOcKYQiaY/rE=; b=IB9QrjTwv8oFyv8RKo+cywcEMK+in5KGAmlyt1vV+Im6O8n58L20UcYWorvEMrswW/ 5Jl2XfNSjfXIDylaU1FFCxdjwXIqW4e/5GOzf6mX/VSTZkPKHqkx4mgJnimwDTtrnBe0 sXUht6tQlnh/nWoQ04sTJRJIfyzGkH+TVHvePJ37erpAbT2g4K9sJRANFOoVWwiODbRG qLlZuRkxBFR11bEoJ4aHwAbLbstxVfiFqCLnqi8F6bf94yKFYz3T/pC7rI0Di0GwE27L s/JxufDj1V2rTR0L6h6eX/g3mmpNnXWu9jV71XaRqHmyT4SjawFxd/QEq2fzgfu5QQ4V w/ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739330845; x=1739935645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wblqpLdDOzzXtmdXTdBplqjywGYcu1aJOcKYQiaY/rE=; b=P37mnQ1rC0EcknoZr6yhyGSf4sIa+hW0U5KI4DeLDibtBIy7SdpRknqDGrIGnTQ3DC 0DXxXIuw42meV4sQqwufzIBj39B6Nw+NK6syva8xwG6F3YtQrPgfJ4JtQYIbklqoITIE mVLPYMhUcXc7PnpmfLQxEMHVhzzFpbTM5Lbwp5TTzttcTqp5l6YFbhy9bH/xSgz5yhCw nggLVsXgt9iek5uL/6MPLdcB0v3bS9NlmKjlGSyLSWx6i9QbKcL31RMqbvCmb+Ao9GYn G6aHQqBCy4V5qsVLILsNLsVtlwcMoogBALgicH0SWGEeSaLCXNQ/7lbvC20txB0ZQQSc yBBA== X-Forwarded-Encrypted: i=1; AJvYcCVkhoWWUwnUOxFZmKgLU11QWLooIyfhSC9RV8DG3b5C4zmCuEYrl1SB9SRRl6Co1w/fHwA=@vger.kernel.org X-Gm-Message-State: AOJu0Yxnrl28Lfzw6eq6axtvyXCrEzfXEd4D4CJ0doN+xQfIIvqKldUb M0o9XQtCsXw04NEqETNh68NXY3Ky6W/fvl7Osjxkxu+EFpkng+tv X-Gm-Gg: ASbGncv9U9thqfccfFEvNR8r6J39VS35foPzYJt6GxclLME1CJUFegwjDAwXwkLUypc RraCgcDqJENedf9OxYhVNhKCOu1oyLfyp6NeKvDFU3QonfYj/233nvI0/aD4bPvxWIryE+oXaeT 5+kn9YtS5+dZnaaHEdJLRq66NYDcJX5NW36nGX8HLT59g5gL19CBmtDi9esOJvg5LfYM9FKkyUc dcgZ3IWDn6vXiIMbVs+lkU5VAnY0txZwAUrOvzJGL8BOJGa74DyEzzR0JiuoK1sUU+U2WLtJhan eW3hgeTcvk2yZXU+2RW3aGmkgUralz/KuSdL+tE= X-Google-Smtp-Source: AGHT+IEbwdqbJNj5RaDUaAvkfsN3UVNjdqH8BKYpai6VI1xuJE3yeGV9JMQ9Y62yWUKaBmsWDXZ9YQ== X-Received: by 2002:a05:6a21:b98:b0:1e8:c159:b6ef with SMTP id adf61e73a8af0-1ee5c82193emr2947640637.37.1739330844708; Tue, 11 Feb 2025 19:27:24 -0800 (PST) Received: from gamma.hsd1.ca.comcast.net ([2601:647:5580:5760:508a:741e:539b:1c5c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73048ae7f6esm10129577b3a.74.2025.02.11.19.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 19:27:24 -0800 (PST) From: Illia Bobyr To: Junio C Hamano Cc: Illia Bobyr , git@vger.kernel.org Subject: [PATCH v5 10/10] diff: docs: Use --patch-{grep,modifies} over -G/-S Date: Tue, 11 Feb 2025 19:26:54 -0800 Message-ID: <20250212032657.1807939-11-illia.bobyr@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250212032657.1807939-1-illia.bobyr@gmail.com> References: <20250206014324.1839232-1-illia.bobyr@gmail.com> <20250212032657.1807939-1-illia.bobyr@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Long argument names are easier to read, compared to short ones. So while short arguments are great when you want to type a command quickly, the documentation readability is improved if we use long argument names. Note for reviewers: All changes are just a replacement of `-G` with `--patch-grep` and `-S` with `--patch-modifies`. But as the text was reformatted to fit the same width in a few places it might look like there are more changes, if the diff is only line-wise and not word-wise. The only an exception are changes in `gitdiffcore.adoc`, where I did rephrase a sentence. I've moved introduction of the short versions of the `--patch-{grep,modifies}` into a subsequent paragraph. The reason is that I wanted to keep a note on the `-G` mnemonic, and it was awkward if I would repeat the short definition twice over a span of two paragraphs. --- Documentation/diff-options.txt | 34 ++++++++++----------- Documentation/git-blame.txt | 2 +- Documentation/gitdiffcore.txt | 55 +++++++++++++++++----------------- 3 files changed, 46 insertions(+), 45 deletions(-) diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 07413d..c9f7c 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -658,8 +658,8 @@ renamed entries cannot appear if detection for those types is disabled. It is useful when you're looking for an exact block of code (like a struct), and want to know the history of that block since it first came into being: use the feature iteratively to feed the interesting -block in the preimage back into `-S`, and keep going until you get the -very first version of the block. +block in the preimage back into `--patch-modifies`, and keep going until +you get the very first version of the block. + Binary files are searched as well. @@ -668,9 +668,9 @@ Binary files are searched as well. Look for differences whose patch text contains added/removed lines that match __. + -To illustrate the difference between `-S` `--pickaxe-regex` and -`-G`, consider a commit with the following diff in the same -file: +To illustrate the difference between `--patch-modifies= +--pickaxe-regex` and `--patch-grep=`, consider a commit with the +following diff in the same file: + ---- + return frotz(nitfol, two->ptr, 1, 0); @@ -678,9 +678,9 @@ file: - hit = frotz(nitfol, mf2.ptr, 1, 0); ---- + -While `git log -G"frotz\(nitfol"` will show this commit, `git log --S"frotz\(nitfol" --pickaxe-regex` will not (because the number of -occurrences of that string did not change). +While `git log --patch-grep="frotz\(nitfol"` will show this commit, `git +log --patch-modifies="frotz\(nitfol" --pickaxe-regex` will not (because the +number of occurrences of that string did not change). + Unless `--text` is supplied patches of binary files without a textconv filter will be ignored. @@ -689,22 +689,22 @@ See the 'pickaxe' entry in linkgit:gitdiffcore[7] for more information. `--find-object=`:: - Look for differences that change the number of occurrences of - the specified object. Similar to `-S`, just the argument is different - in that it doesn't search for a specific string but for a specific - object id. + Look for differences that change the number of occurrences of the + specified object. Similar to `--patch-modifies`, just the argument + is different in that it doesn't search for a specific string but + for a specific object id. + The object can be a blob or a submodule commit. It implies the `-t` option in `git-log` to also find trees. `--pickaxe-all`:: - When `-S` or `-G` finds a change, show all the changes in that - changeset, not just the files that contain the change - in __. + When `--patch-modifies` or `--patch-grep` finds a change, show all + the changes in that changeset, not just the files that contain the + change in __. `--pickaxe-regex`:: - Treat the __ given to `-S` as an extended POSIX regular - expression to match. + Treat the __ given to `--patch-modifies` as an extended + POSIX regular expression to match. endif::git-format-patch[] diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt index b1d7fb..0f21d3 100644 --- a/Documentation/git-blame.txt +++ b/Documentation/git-blame.txt @@ -41,7 +41,7 @@ a text string in the diff. A small example of the pickaxe interface that searches for `blame_usage`: ----------------------------------------------------------------------------- -$ git log --pretty=oneline -S'blame_usage' +$ git log --pretty=oneline --patch-modifies='blame_usage' 5040f17eba15504bad66b14a645bddd9b015ebb7 blame -S ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output ----------------------------------------------------------------------------- diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt index e934b9..e7f98 100644 --- a/Documentation/gitdiffcore.txt +++ b/Documentation/gitdiffcore.txt @@ -245,33 +245,34 @@ diffcore-pickaxe: For Detecting Addition/Deletion of Specified String This transformation limits the set of filepairs to those that change specified strings between the preimage and the postimage in a certain -way. `--patch-modifies=` (`-S` for short) and -`--patch-grep=` (`-G` for short) are used to specify -different ways these strings are sought. - -`-S` detects filepairs whose preimage and postimage -have different number of occurrences of the specified __. -By definition, it will not detect in-file moves. Also, when a -changeset moves a file wholesale without affecting the interesting -string, diffcore-rename kicks in as usual, and `-S` omits the filepair -(since the number of occurrences of that string didn't change in that -rename-detected filepair). When used with `--pickaxe-regex`, treat -the __ as an extended POSIX regular expression to match, -instead of a literal string. - -`-G` (mnemonic: grep) detects filepairs whose textual diff has -an added or a deleted line that matches the given __. This -means that it will detect in-file (or what rename-detection considers -the same file) moves, which is noise. The implementation runs diff -twice and greps, and this can be quite expensive. To speed things up, -binary files without textconv filters will be ignored. - -When `-S` or `-G` are used without `--pickaxe-all`, only filepairs -that match their respective criterion are kept in the output. When -`--pickaxe-all` is used, if even one filepair matches their respective -criterion in a changeset, the entire changeset is kept. This behavior -is designed to make reviewing changes in the context of the whole -changeset easier. +way. `--patch-modifies=` and `--patch-grep=` are used +to specify different ways these strings are sought. + +`--patch-modifies=` (`-S` for short) detects filepairs +whose preimage and postimage have different number of occurrences of +the specified __. By definition, it will not detect in-file +moves. Also, when a changeset moves a file wholesale without +affecting the interesting string, diffcore-rename kicks in as usual, +and `--patch-modifies` omits the filepair (since the number of +occurrences of that string didn't change in that rename-detected +filepair). When used with `--pickaxe-regex`, treat the __ as +an extended POSIX regular expression to match, instead of a literal +string. + +`--patch-grep=` (`-G` for short, mnemonic: grep) detects +filepairs whose textual diff has an added or a deleted line that +matches the given regular expression. This means that it will detect +in-file (or what rename-detection considers the same file) moves, +which is noise. The implementation runs diff twice and greps, and +this can be quite expensive. To speed things up, binary files without +textconv filters will be ignored. + +When `--patch-modifies` or `--patch-grep` are used without +`--pickaxe-all`, only filepairs that match their respective criterion +are kept in the output. When `--pickaxe-all` is used, if even one +filepair matches their respective criterion in a changeset, the entire +changeset is kept. This behavior is designed to make reviewing +changes in the context of the whole changeset easier. diffcore-order: For Sorting the Output Based on Filenames ---------------------------------------------------------