{"thread":{"id":"11882","subject":"[PATCH 7/9] Export create_branch() from builtin-branch.c","startedAt":"2008-02-04T18:36:02Z","lastAt":"2008-02-05T20:39:02Z","messageCount":3,"participants":["Daniel Barkalow","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"67407","messageId":"alpine.LNX.1.00.0802041336010.13593@iabervon.org","threadId":"11882","inReplyTo":null,"subject":"[PATCH 7/9] Export create_branch() from builtin-branch.c","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-04T18:36:02Z","receivedAt":"2008-02-04T18:36:02Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"You can also create branches, in exactly the same way, with checkout -b.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n builtin-branch.c |    4 ++--\n cache.h          |    4 ++++\n 2 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-branch.c b/builtin-branch.c\nindex 089cae5..04e377d 100644\n--- a/builtin-branch.c\n+++ b/builtin-branch.c\n@@ -422,8 +422,8 @@ static int setup_tracking(const char *new_ref, const char *orig_ref)\n \treturn 0;\n }\n \n-static void create_branch(const char *name, const char *start_name,\n-\t\t\t  int force, int reflog, int track)\n+void create_branch(const char *name, const char *start_name,\n+\t\t   int force, int reflog, int track)\n {\n \tstruct ref_lock *lock;\n \tstruct commit *commit;\ndiff --git a/cache.h b/cache.h\nindex e4aeff0..97edbf1 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -680,6 +680,10 @@ extern int convert_to_working_tree(const char *path, const char *src, size_t len\n /* add */\n void add_files_to_cache(int verbose, const char *prefix, const char **pathspec);\n \n+/* branch */\n+void create_branch(const char *name, const char *start_name,\n+\t\t   int force, int reflog, int track);\n+\n /* diff.c */\n extern int diff_auto_refresh_index;\n \n-- \n1.5.4\n"},{"id":"67467","messageId":"alpine.LSU.1.00.0802050136440.8543@racer.site","threadId":"11882","inReplyTo":"alpine.LNX.1.00.0802041336010.13593@iabervon.org","subject":"Re: [PATCH 7/9] Export create_branch() from builtin-branch.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-05T01:38:08Z","receivedAt":"2008-02-05T01:38:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 4 Feb 2008, Daniel Barkalow wrote:\n\n> You can also create branches, in exactly the same way, with checkout -b.\n> \n> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> ---\n>  builtin-branch.c |    4 ++--\n>  cache.h          |    4 ++++\n\nNote that builtin-branch.c is not part of libgit.a, so you are only moving \nthe declaration into the \"libgit\" part.\n\nMaybe it would be better to move this function, say, into refs.c?\n\nCiao,\nDscho\n"},{"id":"67551","messageId":"alpine.LNX.1.00.0802042139170.13593@iabervon.org","threadId":"11882","inReplyTo":"alpine.LSU.1.00.0802050136440.8543@racer.site","subject":"Re: [PATCH 7/9] Export create_branch() from builtin-branch.c","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-05T20:39:02Z","receivedAt":"2008-02-05T20:39:02Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 5 Feb 2008, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Mon, 4 Feb 2008, Daniel Barkalow wrote:\n> \n> > You can also create branches, in exactly the same way, with checkout -b.\n> > \n> > Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> > ---\n> >  builtin-branch.c |    4 ++--\n> >  cache.h          |    4 ++++\n> \n> Note that builtin-branch.c is not part of libgit.a, so you are only moving \n> the declaration into the \"libgit\" part.\n> \n> Maybe it would be better to move this function, say, into refs.c?\n\nI think it's actually time to start a branch.{c,h} library file for \noperations that deal with the porcelain-ish information about branches. \nThis would go there, and a function to discard MERGE_HEAD and similar \nfiles (whatever they are, which isn't currently collected anywhere \nauthoritative). Probably also most of the other stuff that should be \nshared between reset and checkout, too, and functions should probably \nmigrate there from builtin-branch and builtin-checkout as they become \nneeded, leaving the builtin-* code as command-line parsing and calls to \nthese functions. In any case, I'll start with this.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}