git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A new approach to Git's clone process for improved functionality | Maifee Ul Asad
@ 2023-03-26 14:55 Maifee Ul Asad
  0 siblings, 0 replies; only message in thread
From: Maifee Ul Asad @ 2023-03-26 14:55 UTC (permalink / raw)
  To: git

Dear,

I am Maifee Ul Asad. I have been studying Git's codebase for a while
now. And there is something I noticed about clone functionality.
Whenever I run a clone operation it creates five independent
processes. Now the only way to cancel this cloning operation is
through CLI, press CTRL+C or a relevant command based on different OS.
I have only checked in Windows.

But, when I am creating a wrapper, or I have some existing wrapper for
Git, and I want to add functionality to cancel the cloning process, it
can not be done so easily. Then I have to create a process and pass a
signal interrupt via stdin of that process and cancel it.

I think it would be way cool and lot cleaner if we could create a
parent process and add these processes as children to that parent
process. In this case, we can simply use kill to terminate that parent
process.

Till now I was only able to identify these operations, and I am pretty
helpful they I have identified the correct functions:
 - perform the fetch operation
 - perform the receive-pack operation
 - perform the indexing operation
 - perform the pack-objects operation
 - perform the update-ref operation


Now we can simply wrap these with a fork (yes, we have to think about
NT not having a fork; and cygwin and other libraries may add tons of
load here) call. But here is my proposed pseudo code:
```
fork a new process
if (fork failed):
    log and exit
else if (fork is successful):
    perform the fetch operation
    perform the receive-pack operation
    perform the indexing operation
    perform the pack-objects operation
    perform the update-ref operation
else:
    wait for the child processes to finish
```

I think it would be a great improvement. And, I am really excited
about the discussion we are going to have on this.

Regards
Maifee Ul Asad

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-26 14:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 14:55 A new approach to Git's clone process for improved functionality | Maifee Ul Asad Maifee Ul Asad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).