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

Re: [PATCH 2/4] remove_index_entry_at: move documentation to cache.h

From
Stefan Beller <sbeller@google.com>
Date
Jan 18, 2017, 22:06 UTC
Message-ID
<CAGZ79kYoZOWDHewA4f9VjVkEZBXWaG5Uq8nU=M30mE535zVa2Q@mail.gmail.com>
In-Reply-To
<xmqqfukg3w7t.fsf@gitster.mtv.corp.google.com>
On Wed, Jan 18, 2017 at 1:16 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 29 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> Signed-off-by: Stefan Beller <sbeller@google.com>
>> ---
>>  cache.h      | 3 +++
>>  read-cache.c | 1 -
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/cache.h b/cache.h
>> index 270a0d0ea7..26632065a5 100644
>> --- a/cache.h
>> +++ b/cache.h
>> @@ -599,7 +599,10 @@ extern int index_name_pos(const struct index_state *, const char *name, int name
>>  #define ADD_CACHE_KEEP_CACHE_TREE 32 /* Do not invalidate cache-tree */
>>  extern int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
>>  extern void rename_index_entry_at(struct index_state *, int pos, const char *new_name);
>> +
>> +/* Remove entry, return 1 if there are more entries after pos. */
>>  extern int remove_index_entry_at(struct index_state *, int pos);
>
> What is the reason why this now promise to return 1, as opposed to
> the original that were allowed to return anything that is "true"?
> Is it because you are adding other return values that mean different
> things?
>
> If that is the case it may be fine (it depends on what these other
> values mean and what use case it supports), but please do that in a
> separate patch.
>

Actually my line of thinking was to improve the correctness by being more specific.

In a reroll I move the comment verbatim.
Previous: Junio C HamanoNext: Stefan Beller
Message 4 of 25 in “start documenting core functions”
  1. 0/4 start documenting core functionsStefan Beller, Jan 17, 2017
  2. 2/4 remove_index_entry_at: move documentation to cache.hStefan Beller, Jan 17, 2017
  3. Junio C HamanoJan 18, 2017
  4. Stefan BellerJan 18, 2017
  5. 1/4 document index_name_posStefan Beller, Jan 17, 2017
  6. Junio C HamanoJan 18, 2017
  7. Stefan BellerJan 18, 2017
  8. 3/4 document add_[file_]to_indexStefan Beller, Jan 17, 2017
  9. Junio C HamanoJan 18, 2017
  10. Stefan BellerJan 18, 2017
  11. 4/4 documentation: retire unfinished documentationStefan Beller, Jan 17, 2017
  12. Junio C HamanoJan 18, 2017
  13. 0/4 start documenting core functionsStefan Beller, Jan 18, 2017
  14. 2/4 cache.h: document remove_index_entry_atStefan Beller, Jan 18, 2017
  15. 3/4 cache.h: document add_[file_]to_indexStefan Beller, Jan 18, 2017
  16. Brandon WilliamsJan 19, 2017
  17. Stefan BellerJan 19, 2017
  18. 1/4 cache.h: document index_name_posStefan Beller, Jan 18, 2017
  19. 0/4 start documenting core functionsStefan Beller, Jan 19, 2017
  20. 1/4 cache.h: document index_name_posStefan Beller, Jan 19, 2017
  21. Junio C HamanoJan 19, 2017
  22. 2/4 cache.h: document remove_index_entry_atStefan Beller, Jan 19, 2017
  23. 4/4 documentation: retire unfinished documentationStefan Beller, Jan 19, 2017
  24. 3/4 cache.h: document add_[file_]to_indexStefan Beller, Jan 19, 2017
  25. 4/4 documentation: retire unfinished documentationStefan Beller, Jan 18, 2017

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.