setup_git_directory_gently contract question?

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

setup_git_directory_gently contract question?

From: Ciprian Dorin Craciun <hidden>
Date: 2016-06-15 22:44:39

    Is the function setup_git_directory_gently supposed to change the
current working directory, or should it keep the initial one?
    What is the meaning of nongit_ok?

    Because if I use nongit_ok != NULL, but *nongit_ok == 1, this
function changes the current working directory to the top of the
worktree directory.

    Thanks,
    Ciprian Craciun.

Re: setup_git_directory_gently contract question?

From: Ciprian Dorin Craciun <hidden>
Date: 2016-06-15 22:44:39

    Or another question: how can I obtain the git directory (.git)
(absolute) path without updating the current working directory?

    Thanks,
    Ciprian Craciun.


On Tue, May 27, 2008 at 5:10 PM, Ciprian Dorin Craciun
[off-list ref] wrote:
   Is the function setup_git_directory_gently supposed to change the
current working directory, or should it keep the initial one?
   What is the meaning of nongit_ok?

   Because if I use nongit_ok != NULL, but *nongit_ok == 1, this
function changes the current working directory to the top of the
worktree directory.

   Thanks,
   Ciprian Craciun.

Re: setup_git_directory_gently contract question?

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:44:39

On Tue, May 27, 2008 at 9:10 PM, Ciprian Dorin Craciun
[off-list ref] wrote:
   Is the function setup_git_directory_gently supposed to change the
current working directory, or should it keep the initial one?
It will change if it finds a worktree.
   What is the meaning of nongit_ok?
Setting it to a non null pointer prevents git from die() when no git
repository can be found.
   Because if I use nongit_ok != NULL, but *nongit_ok == 1, this
function changes the current working directory to the top of the
worktree directory.
It returns a directory prefix so that you can still know the original
current working directory. You can do as following to have current
directory "unchanged"

prefix = setup_git_directory_gently(&nongit_ok);
if (prefix) chdir(prefix)
   Thanks,
   Ciprian Craciun.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help