top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Rewriting in C

+1 vote

I'd like to rewrite the repack shell script in C. So I tried the naive approach reading the man page and
the script itself and write C program by matching each block/line of the script with a function in C

Now I stumble upon other git commands (git pack-objects). What's the best way to approach such a plumbing command?

I don't think just calling cmd_pack_objects(argc, **argv) would be the right thing to do, as we're not using all the command line parameters, so some of the logic in cmd_pack_object could be skipped.
Another approach would be to use some of the functions as used by cmd_pack_objects, but these mostly reside in builtin/pack_objects.c. They'd need to be moved up to pack.h/pack.c.

So my question is, how you'd generally approach rewriting a shell script in C.

posted Aug 2, 2013 by Mandeep Sehgal

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote

Start a new process via start_command/run_command interface. It's safer to retain the process boundary at this stage. You can try to integrate further later.

answer Aug 2, 2013 by Luv Kumar
Similar Questions
+2 votes

Is it possible to use a git library in a C Program?
Does someone know, if it is possible to include GIT source as part of my program?

0 votes

I work on some files and push/merge them to the remote server. Sometimes I get merge conflicts on those files and have to fix them. That's completely fine. I get that.

What I don't understand is that sometimes during this process I will get merge conflicts in files _I have never touched_. In fact they are in a completely different series of directories to the one I am working on and someone else project entirely. How am I meant to know how to fix these? I dont know what the other developer wanted to do and if they have done it right.

I thought git only merged/pushed the files you have changed? If someone else has changed Group A files on the remote repo, why must I change my local Group A files when I am _pushing _completely different set of Group B files?

Sure, Id understand if I were pulling files down to my local and had to resolve merge conflicts then, but this isn't happening when I push the files up.

Any help or advice is much appreciated. Sorry if I sound frustrated - I am really trying hard to get my head round this whole git thing but its just so weird.

0 votes

I have a local repository and a remote at GitHub. My local repo had a master branch and the remote had only a gh-pages branch.

I wanted to pull from my gh-pages remote branch (with "git pull origin gh-pages"). I was about to commit on the master branch and I realized I had no local gh-pages branch. So I put a blank message, to avoid commiting to the master branch.

I unstaged the changes with "git reset HEAD", but how can I remove the already fetched files. I mean, is there something I have to do after unstaging the fetched files?

Many thanks for your help,

+1 vote

Lets say I've got a topic branch. I've made a bunch of commits. It's messy. But it's done.

As I understand it, best practice is to do a squash commit of the whole thing onto the parent branch (develop or master, depending on workflow). And I can do that.

What do I do with the leftover? I thought I could tag it as "closed", but I can't use the same tag more than once. What's the best way to mark it as done, or should I just delete the branch label and let it be garbage collected/deleted?

Useful Links with Similar Problem
Contact Us
+91 9880187415
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.