git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] stripspace: allow -s/-c outside git repository

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 18, 2018, 12:00 UTC
Message-ID
<nycvar.QRO.7.76.6.1812181258550.43@tvgsbejvaqbjf.bet>
In-Reply-To
<CAN0heSoekZ_vjR6DRjSAfw74hn_NU3-5TFf6-Hn9z2D_zE-mNg@mail.gmail.com>
Hi Martin,
On Tue, 18 Dec 2018, Martin Ågren wrote:
Show 16 quoted lines
> On Mon, 17 Dec 2018 at 22:56, Jonathan Nieder <jrnieder@gmail.com> wrote:
> > That makes experimenting with the stripspace command unnecessarily
> > fussy.  Fix it by discovering the git directory gently, as intended
> > all along.
> 
> >         if (mode == STRIP_COMMENTS || mode == COMMENT_LINES) {
> > -               setup_git_directory_gently(NULL);
> > +               setup_git_directory_gently(&nongit);
> >                 git_config(git_default_config, NULL);
> >         }
> 
> Makes me wonder if `setup_git_directory_gently()` should BUG if it
> receives NULL. That would require some reshuffling in setup.c, since
> `setup_git_directory()` calls out to it with NULL... Just thinking out
> loud. In any case, and more importantly, this is the last user providing
> NULL except for the one in `setup_git_directory()`.

We could rename `setup_git_directory_gently()` to `setup_git_directory_gently_2()`, make that `static` and then call it from `setup_git_directory_gently()` and `setup_git_directory()`.

Ciao, Dscho

Previous: Martin ÅgrenNext: Martin Ågren
Message 3 of 17 in “stripspace: allow -s/-c outside git repository”
  1. stripspace: allow -s/-c outside git repositoryJonathan Nieder, Dec 17, 2018
  2. Martin ÅgrenDec 18, 2018
  3. Johannes SchindelinDec 18, 2018
  4. Martin ÅgrenDec 19, 2018
  5. Johannes SchindelinDec 18, 2018
  6. Referring to commits in commit messagesÆvar Arnfjörð Bjarmason, Dec 19, 2018
  7. Duy NguyenDec 19, 2018
  8. Jonathan NiederDec 19, 2018
  9. Ævar Arnfjörð BjarmasonDec 20, 2018
  10. Jacob KellerDec 24, 2018
  11. SZEDER GáborDec 19, 2018
  12. Jeff KingDec 19, 2018
  13. Jonathan NiederDec 19, 2018
  14. Jeff KingDec 19, 2018
  15. Jonathan NiederDec 19, 2018
  16. Jeff KingDec 20, 2018
  17. Ævar Arnfjörð BjarmasonDec 19, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.