From 4ab0020e896138f891f915f108b0270fb1ee3bd9 Mon Sep 17 00:00:00 2001 From: "D. Ben Knoble" Date: Wed, 7 Aug 2024 10:51:15 -0400 Subject: [PATCH] git-ed: uniq the list of files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid a large argument list in Vim from duplicate files when a series of commits touches the same files multiple times. This should probably change to use null-separated filenames for correctness; BSD sort accepts -z, but uniq does not… --- links/bin/git-ed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/links/bin/git-ed b/links/bin/git-ed index ebdf7a5e..aa1c4779 100755 --- a/links/bin/git-ed +++ b/links/bin/git-ed @@ -48,7 +48,7 @@ main() { ;; esac local files=() - mapfile -t files < <("$func" "$@") + mapfile -t files < <("$func" "$@" | sort | uniq) if (( ${#files[@]} > 0 )); then # file names are relative to repository root cd_to_toplevel && git_editor "${files[@]}"