lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNATWu=LdYgdAX4S6WG3OjN928r-6nFB2HWQRAdAfFS_DeQ@mail.gmail.com>
Date:   Sat, 17 Nov 2018 00:17:45 +0900
From:   Masahiro Yamada <yamada.masahiro@...ionext.com>
To:     Brian Norris <briannorris@...omium.org>
Cc:     alexander.kapshuk@...il.com, Genki Sky <sky@...ki.is>,
        Douglas Anderson <dianders@...omium.org>,
        Guenter Roeck <linux@...ck-us.net>,
        Christian Kujau <lists@...dbynature.de>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        schwab@...ux-m68k.org
Subject: Re: [PATCH v3] scripts/setlocalversion: Improve -dirty check with
 git-status --no-optional-locks

On Thu, Nov 15, 2018 at 11:12 AM Brian Norris <briannorris@...omium.org> wrote:
>
> git-diff-index does not refresh the index for you, so using it for a
> "-dirty" check can give misleading results. Commit 6147b1cf19651
> ("scripts/setlocalversion: git: Make -dirty check more robust") tried to
> fix this by switching to git-status, but it overlooked the fact that
> git-status also writes to the .git directory of the source tree, which
> is definitely not kosher for an out-of-tree (O=) build. That is getting
> reverted.
>
> Fortunately, git-status now supports avoiding writing to the index via
> the --no-optional-locks flag, as of git 2.14. It still calculates an
> up-to-date index, but it avoids writing it out to the .git directory.
>
> So, let's retry the solution from commit 6147b1cf19651 using this new
> flag first, and if it fails, we assume this is an older version of git
> and just use the old git-diff-index method.
>
> It's hairy to get the 'grep -vq' (inverted matching) correct by stashing
> the output of git-status (you have to be careful about the difference
> betwen "empty stdin" and "blank line on stdin"), so just pipe the output
> directly to grep and use a regex that's good enough for both the
> git-status and git-diff-index version.
>
> Cc: Genki Sky <sky@...ki.is>
> Cc: Christian Kujau <lists@...dbynature.de>
> Cc: Guenter Roeck <linux@...ck-us.net>
> Suggested-by: Alexander Kapshuk <alexander.kapshuk@...il.com>
> Signed-off-by: Brian Norris <briannorris@...omium.org>


Worked for me, and clean implementation. Nice!

I will wait a few days before I pick it up
in case some people may give comments, Reviewed-by, Tested-by, etc.




-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ