From mboxrd@z Thu Jan 1 00:00:00 1970 From: Duy Nguyen Subject: Re: [PATCH v2 01/10] ref-filter: add %(refname:shortalign=X) option Date: Mon, 13 Jul 2015 17:51:35 +0700 Message-ID: References: <1436437671-25600-1-git-send-email-karthik.188@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Junio C Hamano , Git , Christian Couder , Matthieu Moy , Michael Haggerty To: Karthik Nayak X-From: git-owner@vger.kernel.org Mon Jul 13 12:52:13 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZEbLI-0001La-Mc for gcvg-git-2@plane.gmane.org; Mon, 13 Jul 2015 12:52:13 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751117AbbGMKwH (ORCPT ); Mon, 13 Jul 2015 06:52:07 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:36065 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbbGMKwF (ORCPT ); Mon, 13 Jul 2015 06:52:05 -0400 Received: by ieik3 with SMTP id k3so19334401iei.3 for ; Mon, 13 Jul 2015 03:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=oeOzWBx31XnLgMbQwoQ81dIKBEFTLeO4Zx6g8L+nB10=; b=b/ZD4B5PIooYKDi3GYBLQ07jyeDuy/NrPpcicvtOUM9Fj32QJfwnN4LLgqMq1Xpiia mjqPPWkTSC7fhKZoZVisTL0FbfLiXt9uAz6b4GNFf+lokkcp5vS43Uqu5xKEjn6lYMpw M+6wWxJh6c8IZhIVutEkQfxJqeMj0fu58xxQ0gEZvH/FpqMN75DiG/x6QXLRsLXpK95X eBCgDp0pbsBOCVZ6hEp4ZOkdy7/KXrJqSbMD//IAdOmTx2mDppZ/106GW3F8KRgwmFeg NawkVDLLlzIp+LvuonvM4IbqlY6SNXltyIhLKqd4JsM+CT8+pIpCoybVUrZmsJaj2lwk dVMg== X-Received: by 10.107.168.99 with SMTP id r96mr16038351ioe.141.1436784725133; Mon, 13 Jul 2015 03:52:05 -0700 (PDT) Received: by 10.107.16.15 with HTTP; Mon, 13 Jul 2015 03:51:35 -0700 (PDT) In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Mon, Jul 13, 2015 at 2:56 AM, Karthik Nayak wrote: > On Sun, Jul 12, 2015 at 7:17 AM, Duy Nguyen wrote: >> >> I guess if you can have multiple arguments after ':' in an atom, then >> you have wiggle room for future. But it looks like you only accept one >> argument after ':'.. (I only checked the version on 'pu'). Having an >> "alignment atom" to augment the real one (like %< changes the behavior >> of the next placeholder), could also work, but it adds dependency >> between atoms, something I don't think ref-filter.c is ready for. >> > > I was thinking of something on the lines of having a function which right > before printing checks if any "align" option is given to the end of a given > item and aligns it accordingly, this ensures that any item which needs to > have such an option can easily do so. > > https://github.com/KarthikNayak/git/commit/0284320483d6442a6425fc665e740f9f975654a1 > > This is what I came up with, you could have a look and let me know if > you have any > suggestions. Yeah, pretty close to what I described in the other mail. Now if you make "align" a separate atom, I think it would reduce clutter in populate_value() (my personal opinion is this function looks too messy already) and we can easily add more alignment options in future :) -- Duy