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

Re: [PATCH 2/2] SQUASH??? Undecided

From
BWBrandon Williams <bmwill@google.com>
Date
Sep 15, 2016, 21:37 UTC
Message-ID
<CAKoko1qj4FS=g-H0UzeTmKNoJQyxmf5bBsQJFhJjH1hYyFtQcQ@mail.gmail.com>
In-Reply-To
<CAGZ79kaCVZ-Z+XSYWK6YtkT8L=pDrDQE-pAyseHNf5w2NO5XMw@mail.gmail.com>
Yeah if that is the convention then I have no problem with the change.
-Brandon
On Thu, Sep 15, 2016 at 2:12 PM, Stefan Beller <sbeller@google.com> wrote:
Show 51 quoted lines
> + cc Brandon
>
> On Thu, Sep 15, 2016 at 1:51 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> If we were to follow the convention to leave an optional string
>> variable to NULL, we'd need to do this on top.  I am not sure if it
>> is a good change, though.
>
> I think it is a good change.
>
> Thanks,
> Stefan
>
>> ---
>>  builtin/ls-files.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/builtin/ls-files.c b/builtin/ls-files.c
>> index 6e78c71..687e475 100644
>> --- a/builtin/ls-files.c
>> +++ b/builtin/ls-files.c
>> @@ -29,7 +29,7 @@ static int show_valid_bit;
>>  static int line_terminator = '\n';
>>  static int debug_mode;
>>  static int show_eol;
>> -static const char *output_path_prefix = "";
>> +static const char *output_path_prefix;
>>  static int recurse_submodules;
>>
>>  static const char *prefix;
>> @@ -78,7 +78,7 @@ static void write_name(const char *name)
>>          * churn.
>>          */
>>         static struct strbuf full_name = STRBUF_INIT;
>> -       if (*output_path_prefix) {
>> +       if (output_path_prefix && *output_path_prefix) {
>>                 strbuf_reset(&full_name);
>>                 strbuf_addstr(&full_name, output_path_prefix);
>>                 strbuf_addstr(&full_name, name);
>> @@ -181,7 +181,8 @@ static void show_gitlink(const struct cache_entry *ce)
>>         argv_array_push(&cp.args, "ls-files");
>>         argv_array_push(&cp.args, "--recurse-submodules");
>>         argv_array_pushf(&cp.args, "--output-path-prefix=%s%s/",
>> -                        output_path_prefix, ce->name);
>> +                        output_path_prefix ? output_path_prefix : "",
>> +                        ce->name);
>>         cp.git_cmd = 1;
>>         cp.dir = ce->name;
>>         status = run_command(&cp);
>> --
>> 2.10.0-458-g97b4043
>>
Previous: Stefan BellerNext: Junio C Hamano
Message 20 of 22 in “ls-files: adding support for submodules”
  1. ls-files: adding support for submodulesBrandon Williams, Sep 9, 2016
  2. Jeff KingSep 9, 2016
  3. Junio C HamanoSep 9, 2016
  4. Junio C HamanoSep 9, 2016
  5. Stefan BellerSep 9, 2016
  6. Junio C HamanoSep 11, 2016
  7. Jeff KingSep 12, 2016
  8. Jeff KingSep 12, 2016
  9. Junio C HamanoSep 12, 2016
  10. Junio C HamanoSep 12, 2016
  11. ls-files: adding support for submodulesBrandon Williams, Sep 13, 2016
  12. Brandon WilliamsSep 13, 2016
  13. Junio C HamanoSep 13, 2016
  14. Junio C HamanoSep 15, 2016
  15. Junio C HamanoSep 15, 2016
  16. Junio C HamanoSep 15, 2016
  17. Junio C HamanoSep 15, 2016
  18. 2/2 SQUASH??? UndecidedJunio C Hamano, Sep 15, 2016
  19. Stefan BellerSep 15, 2016
  20. Brandon WilliamsSep 15, 2016
  21. 1/2 SQUASH???Junio C Hamano, Sep 15, 2016
  22. Brandon WilliamsSep 12, 2016

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.