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

Re: [Outreachy] Introduction

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Oct 8, 2020, 09:07 UTC
Message-ID
<22e3d737-8621-9f20-307e-fc4c2a47ec0c@gmail.com>
In-Reply-To
<CAHjREB4gsyOrdnhp0_9rs0wv5q5H47-3RcB3fm5NY+L=3SYnMA@mail.gmail.com>
Hi Sangeeta
On 07/10/2020 21:10, Sangeeta NB wrote:
> Hello everyone,
Welcome to the list
Show 13 quoted lines
> My name is Sangeeta and I’m one of the Outreachy applicants.  I would
> like to work on the microproject "Unify the meaning of dirty between
> diff and describe".
> 
> While looking at the files for `describe` and `diff` commands I found
> that the `describe.c`  is present in builtin[1] folder whereas diff.c
> is found in the root[2] folder as well as builtin[3] folder. I could
> not find any implementation of --dirty in the diff.c present in
> builtin[3] folder. So is it that I have to compare the implementation
> of describe.c[1] and diff.c(of root folder)?
> 
> Also, I was curious to know why is there a builtin folder when many
> commands described in that are described again in the root folder?

The files in the root directory are (mostly) library code that ends up in libgit.a. The builtin directory contains the individual git commands that form the git binary that is linked with libgit.a. builtin/diff.c contains cmd_diff() which will be called when the user runs `git diff`. That function parses the command line options and sets up the necessary data to pass to the diff implementation in /diff.c. The diff and log family of commands are a bit different to most of the other commands in that the option parsing is mostly done by calling setup_revisions() in /revision.c rather than using the option parsing library routines in /parse-options.c directly. I think the `--dirty` option for diff ends up being handled by handle_ignore_submodules_arg() in submodule.c, I'll leave it to you to see where that is called from (you can use `git grep`).

I'm going to be off line for the rest of today, hopefully someone else will be able to help if you get stuck or I'll try and answer any other questions tomorrow.

Best Wishes
Phillip
Show 7 quoted lines
> Looking forward to working with you all.
> 
> Sangeeta
> [1] https://github.com/git/git/blob/master/builtin/describe.c
> [2] https://github.com/git/git/blob/master/builtin/diff.c
> [3] https://github.com/git/git/blob/master/diff.c
> 
Previous: Sangeeta NBNext: Sangeeta NB
Message 2 of 17 in “[Outreachy] Introduction”
  1. Sangeeta NBOct 7, 2020
  2. Phillip WoodOct 8, 2020
  3. Sangeeta NBOct 9, 2020
  4. Phillip WoodOct 9, 2020
  5. Sangeeta NBOct 11, 2020
  6. Phillip WoodOct 12, 2020
  7. Kaartic SivaraamOct 12, 2020
  8. Junio C HamanoOct 12, 2020
  9. Sangeeta NBOct 14, 2020
  10. Phillip WoodOct 15, 2020
  11. fixup! diff: do not show submodule with untracked files as "-dirty"Phillip Wood, Oct 15, 2020
  12. Sangeeta NBOct 15, 2020
  13. Phillip WoodOct 15, 2020
  14. Sangeeta NBOct 15, 2020
  15. Phillip WoodOct 15, 2020
  16. Sangeeta NBOct 16, 2020
  17. Phillip WoodOct 16, 2020

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.