From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id EE0121F990 for ; Wed, 5 Aug 2020 22:14:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726071AbgHEWOq (ORCPT ); Wed, 5 Aug 2020 18:14:46 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:56269 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbgHEWOp (ORCPT ); Wed, 5 Aug 2020 18:14:45 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 9D77CE6E11; Wed, 5 Aug 2020 18:14:43 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=R1Z55rCDN+qtriE4mAZA/2ekxXA=; b=J3sXVQ O6vlLjL7ig/PVYkfdwNnU76UsjBD8sneATEWT9roCORNtTdzp1gJ1EUZpJQ1IoNz AC3NxF7bCl2bFHOBmoo1yPRrVVxlXhKm7WsMy/ArTzI5O/GFx0liX39foYMfCX8K 5f/xBlaxq8g4aBsJsR8FUoHfpSSM/2wDVuJto= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=u++mjVYsTHriOChP/STO/lUxsKdtRRVa M3uHi/rT9KUKY60CobnYmW04pPpf9c7mupieHwzfGkpHiORWoM4K9Np9xpltvAyx R4GYSTG+3eKHYovKkqQG4LpWLqe7uAF+iGJ/L3C0xCch10UbItWdnpRLkWs+9gT7 Gpdn+i42SII= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 963E3E6E10; Wed, 5 Aug 2020 18:14:43 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.231.104.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 1A66DE6E0F; Wed, 5 Aug 2020 18:14:41 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Eric Sunshine Cc: =?utf-8?Q?Marco_Trevisan_=28Trevi=C3=B1o=29_via_GitGitGadget?= , Git List , =?utf-8?Q?Mar?= =?utf-8?Q?co_Trevisan_=28Trevi=C3=B1o=29?= Subject: Re: [PATCH 1/3] mergetool-lib: use $XDG_CURRENT_DESKTOP to check GNOME References: <66a026ae678341fe7e93a89e22f76e24282cebaa.1596634463.git.gitgitgadget@gmail.com> Date: Wed, 05 Aug 2020 15:14:39 -0700 In-Reply-To: (Eric Sunshine's message of "Wed, 5 Aug 2020 16:58:04 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 0EFCD6BE-D769-11EA-9608-843F439F7C89-77302942!pb-smtp21.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Eric Sunshine writes: > Rather than looping and mucking with IFS, even easier would be: > > is_desktop () { > case ":$XDG_CURRENT_DESKTOP:" in > *:$1:*) return 0 ;; > *) return 1 ;; > esac > } > > But perhaps that's too magical for people? Nah, that is exactly how 'case' in shell is supposed to be used. Thanks.