* [PATCH 7/9] Export create_branch() from builtin-branch.c
@ 2008-01-25 23:25 Daniel Barkalow
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Barkalow @ 2008-01-25 23:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
You can also create branches, in exactly the same way, with checkout -b.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
builtin-branch.c | 4 ++--
cache.h | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index 089cae5..04e377d 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -422,8 +422,8 @@ static int setup_tracking(const char *new_ref, const char *orig_ref)
return 0;
}
-static void create_branch(const char *name, const char *start_name,
- int force, int reflog, int track)
+void create_branch(const char *name, const char *start_name,
+ int force, int reflog, int track)
{
struct ref_lock *lock;
struct commit *commit;
diff --git a/cache.h b/cache.h
index 549f4bb..ee42eab 100644
--- a/cache.h
+++ b/cache.h
@@ -639,6 +639,10 @@ extern int convert_to_working_tree(const char *path, const char *src, size_t len
/* add */
void add_files_to_cache(int verbose, const char *prefix, const char **pathspec);
+/* branch */
+void create_branch(const char *name, const char *start_name,
+ int force, int reflog, int track);
+
/* diff.c */
extern int diff_auto_refresh_index;
--
1.5.4.rc3.4.g16335
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 7/9] Export create_branch() from builtin-branch.c
@ 2008-02-04 18:36 Daniel Barkalow
2008-02-05 1:38 ` Johannes Schindelin
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Barkalow @ 2008-02-04 18:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
You can also create branches, in exactly the same way, with checkout -b.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
builtin-branch.c | 4 ++--
cache.h | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index 089cae5..04e377d 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -422,8 +422,8 @@ static int setup_tracking(const char *new_ref, const char *orig_ref)
return 0;
}
-static void create_branch(const char *name, const char *start_name,
- int force, int reflog, int track)
+void create_branch(const char *name, const char *start_name,
+ int force, int reflog, int track)
{
struct ref_lock *lock;
struct commit *commit;
diff --git a/cache.h b/cache.h
index e4aeff0..97edbf1 100644
--- a/cache.h
+++ b/cache.h
@@ -680,6 +680,10 @@ extern int convert_to_working_tree(const char *path, const char *src, size_t len
/* add */
void add_files_to_cache(int verbose, const char *prefix, const char **pathspec);
+/* branch */
+void create_branch(const char *name, const char *start_name,
+ int force, int reflog, int track);
+
/* diff.c */
extern int diff_auto_refresh_index;
--
1.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 7/9] Export create_branch() from builtin-branch.c
2008-02-04 18:36 [PATCH 7/9] Export create_branch() from builtin-branch.c Daniel Barkalow
@ 2008-02-05 1:38 ` Johannes Schindelin
2008-02-05 20:39 ` Daniel Barkalow
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2008-02-05 1:38 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: Junio C Hamano, git
Hi,
On Mon, 4 Feb 2008, Daniel Barkalow wrote:
> You can also create branches, in exactly the same way, with checkout -b.
>
> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> ---
> builtin-branch.c | 4 ++--
> cache.h | 4 ++++
Note that builtin-branch.c is not part of libgit.a, so you are only moving
the declaration into the "libgit" part.
Maybe it would be better to move this function, say, into refs.c?
Ciao,
Dscho
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 7/9] Export create_branch() from builtin-branch.c
2008-02-05 1:38 ` Johannes Schindelin
@ 2008-02-05 20:39 ` Daniel Barkalow
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Barkalow @ 2008-02-05 20:39 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
On Tue, 5 Feb 2008, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 4 Feb 2008, Daniel Barkalow wrote:
>
> > You can also create branches, in exactly the same way, with checkout -b.
> >
> > Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> > ---
> > builtin-branch.c | 4 ++--
> > cache.h | 4 ++++
>
> Note that builtin-branch.c is not part of libgit.a, so you are only moving
> the declaration into the "libgit" part.
>
> Maybe it would be better to move this function, say, into refs.c?
I think it's actually time to start a branch.{c,h} library file for
operations that deal with the porcelain-ish information about branches.
This would go there, and a function to discard MERGE_HEAD and similar
files (whatever they are, which isn't currently collected anywhere
authoritative). Probably also most of the other stuff that should be
shared between reset and checkout, too, and functions should probably
migrate there from builtin-branch and builtin-checkout as they become
needed, leaving the builtin-* code as command-line parsing and calls to
these functions. In any case, I'll start with this.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-05 20:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-04 18:36 [PATCH 7/9] Export create_branch() from builtin-branch.c Daniel Barkalow
2008-02-05 1:38 ` Johannes Schindelin
2008-02-05 20:39 ` Daniel Barkalow
-- strict thread matches above, loose matches on Subject: below --
2008-01-25 23:25 Daniel Barkalow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox