Re: [PATCH] Completion must sort before using uniq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marc Khouzam wrote:
The uniq program only works with sorted input.  The man page states
"uniq prints the unique lines in a sorted file".
...
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -321,7 +321,7 @@ __git_refs ()
                               if [[ "$ref" == "$cur"* ]]; then
                                       echo "$ref"
                               fi
-                       done | uniq -u
+                       done | sort | uniq -u

Is 'sort -u' not universally available and sufficient here? It is POSIX at least:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sort.html

Bye, Jojo

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]