Re: [GSoC 2014] Replacing object loading/writing layer by libgit2
Hi all, I withdraw this proposal because I realize that I won't be eligible to work in July and August as an F-1 student. Good luck to other applicants! Guanglin 2014-03-20 23:37 GMT+08:00 Guanglin Xu mzguang...@gmail.com: Hello, My name is Guanglin Xu. I am a second-year master student at Sun Yat-sen University in China, majoring in Software Engineering. I am also a perspective PhD student matriculated in the US. I'm planning on doing summer projects which I can work remotely. The GSoC 2014 program of Git project is a great choice. I am kind of a skillful Git user with 4 years' experience in 3 projects. For example, I am a Top 5 contributor in LibVMI project (https://github.com/bdpayne/libvmi); I host a team-made mobile app in Github (https://itunes.apple.com/us/app/ying-yue/id689566688?ls=1mt=8). For more of my projects see here (http://www.andrew.cmu.edu/user/guanglin) To get familiar with the flow of Git development, I worked on microproject [2] and had corresponding conversations with Eric Sunshine, Jacopo Notarstefano and Sun He in threads. Thank you for their comments on my work. Now I've submitted my proposal to google-melange. In brief, I propose to replace object loading/writing layer by libgit2, which comes from the GSoC 2014 ideas page of Git project. Particularly, since I didn't realize where the hardest part is when I looked into the initial aim of this idea, I added a performance requirement that the new implementation should at least not run slower than previous one. Maybe I underestimated specific challenge in working with Git, suggestions or warnings for this topic are all welcomed. Thanks for your consideration for GSoC 2014. Guanglin -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GSoC 2014] Replacing object loading/writing layer by libgit2
Hello, My name is Guanglin Xu. I am a second-year master student at Sun Yat-sen University in China, majoring in Software Engineering. I am also a perspective PhD student matriculated in the US. I'm planning on doing summer projects which I can work remotely. The GSoC 2014 program of Git project is a great choice. I am kind of a skillful Git user with 4 years' experience in 3 projects. For example, I am a Top 5 contributor in LibVMI project (https://github.com/bdpayne/libvmi); I host a team-made mobile app in Github (https://itunes.apple.com/us/app/ying-yue/id689566688?ls=1mt=8). For more of my projects see here (http://www.andrew.cmu.edu/user/guanglin) To get familiar with the flow of Git development, I worked on microproject [2] and had corresponding conversations with Eric Sunshine, Jacopo Notarstefano and Sun He in threads. Thank you for their comments on my work. Now I've submitted my proposal to google-melange. In brief, I propose to replace object loading/writing layer by libgit2, which comes from the GSoC 2014 ideas page of Git project. Particularly, since I didn't realize where the hardest part is when I looked into the initial aim of this idea, I added a performance requirement that the new implementation should at least not run slower than previous one. Maybe I underestimated specific challenge in working with Git, suggestions or warnings for this topic are all welcomed. Thanks for your consideration for GSoC 2014. Guanglin -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4] branch.c: change install_branch_config() to use skip_prefix()
Hi Eric, Yes, you're right. !! is comfortably concise and also idiomatic in Git sources. Thanks, Guanglin 2014-03-03 16:12 GMT+08:00 Eric Sunshine sunsh...@sunshineco.com: On Mon, Mar 3, 2014 at 1:36 AM, Guanglin Xu mzguang...@gmail.com wrote: to avoid a magic code of 11. Helped-by: Sun He sunheeh...@gmail.com Helped-by: Eric Sunshine sunsh...@sunshineco.com Helped-by: Jacopo Notarstefano jaco...@gmail.com Signed-off-by: Guanglin Xu mzguang...@gmail.com --- This is an implementation of the idea#2 of GSoC 2014 microproject. branch.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/branch.c b/branch.c index 723a36b..4eec0ac 100644 --- a/branch.c +++ b/branch.c @@ -49,8 +49,12 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { - const char *shortname = remote + 11; - int remote_is_branch = starts_with(remote, refs/heads/); + const char *shortname = skip_prefix(remote ,refs/heads/); + int remote_is_branch; + if (NULL == shortname) + remote_is_branch = 0; + else + remote_is_branch = 1; A bit verbose. Perhaps just: int remote_is_branch = !!shortname; which you will find to be idiomatic in this project. struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5] branch.c: change install_branch_config() to use skip_prefix()
to avoid a magic code of 11. Helped-by: Sun He sunheeh...@gmail.com Helped-by: Eric Sunshine sunsh...@sunshineco.com Helped-by: Jacopo Notarstefano jaco...@gmail.com Signed-off-by: Guanglin Xu mzguang...@gmail.com --- This is an implementation of the idea#2 of GSoC 2014 microproject. branch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/branch.c b/branch.c index 723a36b..fae7715 100644 --- a/branch.c +++ b/branch.c @@ -49,8 +49,8 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { - const char *shortname = remote + 11; - int remote_is_branch = starts_with(remote, refs/heads/); + const char *shortname = skip_prefix(remote ,refs/heads/); + int remote_is_branch = !!shortname; struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] branch.c: change install_branch_config() to use skip_prefix()
GSoC2014 Microproject: according to the idea#2 for microprojects, change install_branch_config() to use skip_prefix() and make it conform to the usage of previous starts_with(). Signed-off-by: Guanglin Xu mzguang...@gmail.com --- branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch.c b/branch.c index 723a36b..ca4e824 100644 --- a/branch.c +++ b/branch.c @@ -50,7 +50,7 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { const char *shortname = remote + 11; - int remote_is_branch = starts_with(remote, refs/heads/); + int remote_is_branch = (NULL != skip_prefix(remote ,refs/heads/)); struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 Hi, I am Guanglin Xu. I plan to apply for GSoC 2014. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] branch.c: change install_branch_config() to use skip_prefix()
Change install_branch_config() to use skip_prefix() and make it conform to the usage of previous starts_with(). This is because the proper usage of skip_prefix() overrides the functionality of starts_with(). Thorough replacements may finally remove the starts_with() function and reduce code redundency. Signed-off-by: Guanglin Xu mzguang...@gmail.com --- branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch.c b/branch.c index 723a36b..ca4e824 100644 --- a/branch.c +++ b/branch.c @@ -50,7 +50,7 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { const char *shortname = remote + 11; - int remote_is_branch = starts_with(remote, refs/heads/); + int remote_is_branch = (NULL != skip_prefix(remote ,refs/heads/)); struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 Hi, I am Guanglin Xu. I plan to apply for GSoC 2014. This patch is in accordance with the idea#2 of GSoC2014 Microproject. Any comments are welcomed. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] branch.c: change install_branch_config() to use skip_prefix()
Hi Jacopo, Thanks for your comments. I just update this PATCH as v2. I appreciate more comments from you and others in the new thread. Regards, Guanglin 2014-03-02 22:01 GMT+08:00 Jacopo Notarstefano jacopo.notarstef...@gmail.com: The part about this being a GSoC microproject should go below the three dashes, since it's not information that needs to be recorded in the codebase. On Sun, Mar 2, 2014 at 12:52 PM, Guanglin Xu mzguang...@gmail.com wrote: GSoC2014 Microproject: according to the idea#2 for microprojects, change install_branch_config() to use skip_prefix() and make it conform to the usage of previous starts_with(). Signed-off-by: Guanglin Xu mzguang...@gmail.com --- branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch.c b/branch.c index 723a36b..ca4e824 100644 --- a/branch.c +++ b/branch.c @@ -50,7 +50,7 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { const char *shortname = remote + 11; - int remote_is_branch = starts_with(remote, refs/heads/); + int remote_is_branch = (NULL != skip_prefix(remote ,refs/heads/)); struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 Hi, I am Guanglin Xu. I plan to apply for GSoC 2014. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] branch.c: change install_branch_config() to use skip_prefix()
2014-03-03 6:56 GMT+08:00 Eric Sunshine sunsh...@sunshineco.com: Thanks for the submission. Comments below to give you a taste of the Git review process... On Sun, Mar 2, 2014 at 10:55 AM, Guanglin Xu mzguang...@gmail.com wrote: Change install_branch_config() to use skip_prefix() and make it conform to the usage of previous starts_with(). This is because the proper usage of skip_prefix() overrides the functionality of starts_with(). Thorough replacements may finally remove the starts_with() function and reduce code redundency. Justifying a change is certainly a good idea, however, the above reasoning for this particular change is off mark. See below. Also, wrap commit message lines to 65-70 characters or so. Signed-off-by: Guanglin Xu mzguang...@gmail.com --- branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch.c b/branch.c index 723a36b..ca4e824 100644 --- a/branch.c +++ b/branch.c @@ -50,7 +50,7 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { const char *shortname = remote + 11; - int remote_is_branch = starts_with(remote, refs/heads/); + int remote_is_branch = (NULL != skip_prefix(remote ,refs/heads/)); This actually makes the code more difficult to read and understand. There's a more fundamental reason to use skip_prefix() here. See if you can figure it out. (Hint: shortname) Hi Eric, Thanks for your hint. Now I wonder this idea is just to remove the magic code of 11. So I would like to replace this line: const char *shortname = remote + 11; by this line: const char *shortname = skip_prefix(remote, refs/heads/); and keep the next line unchanged. Am I right? struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 Hi, I am Guanglin Xu. I plan to apply for GSoC 2014. This patch is in accordance with the idea#2 of GSoC2014 Microproject. Any comments are welcomed. This sort of commentary, which is appropriate to the email discussion but not meant for permanent project history, should be placed immediately below the --- line following your sign-off. Apologize for bad format. I am going to fix it by PATCH v3. Guanglin -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3] branch.c: change install_branch_config() to use skip_prefix()
to avoid a magic code of 11. Helped-by: Eric Sunshine sunsh...@sunshineco.com Helped-by: Jacopo Notarstefano jaco...@gmail.com Signed-off-by: Guanglin Xu mzguang...@gmail.com --- This is an implementation of the idea#2 of GSoC 2014 microproject. branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch.c b/branch.c index 723a36b..3e2551e 100644 --- a/branch.c +++ b/branch.c @@ -49,7 +49,7 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { - const char *shortname = remote + 11; + const char *shortname = skip_prefix(remote ,refs/heads/); int remote_is_branch = starts_with(remote, refs/heads/); struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] branch.c: change install_branch_config() to use skip_prefix()
2014-03-03 13:39 GMT+08:00 He Sun sunheeh...@gmail.com: 2014-03-03 10:24 GMT+08:00 Guanglin Xu mzguang...@gmail.com: to avoid a magic code of 11. Helped-by: Eric Sunshine sunsh...@sunshineco.com Helped-by: Jacopo Notarstefano jaco...@gmail.com Signed-off-by: Guanglin Xu mzguang...@gmail.com --- This is an implementation of the idea#2 of GSoC 2014 microproject. branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch.c b/branch.c index 723a36b..3e2551e 100644 --- a/branch.c +++ b/branch.c @@ -49,7 +49,7 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { - const char *shortname = remote + 11; + const char *shortname = skip_prefix(remote ,refs/heads/); int remote_is_branch = starts_with(remote, refs/heads/); Or it may be better to keep remote_is_branch, and replace starts_with with something you have just fixed. Hi He, Thanks for your comments. This PATCH v3 scans the remote twice. It's unnecessary at all. So I decide to post PATCH v4 like this: - const char *shortname = remote + 11; - int remote_is_branch = starts_with(remote, refs/heads/); + const char *shortname = skip_prefix(remote ,refs/heads/); + int remote_is_branch; + if (NULL == shortname) + remote_is_branch = 0; + else + remote_is_branch = 1; Guanglin struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4] branch.c: change install_branch_config() to use skip_prefix()
to avoid a magic code of 11. Helped-by: Sun He sunheeh...@gmail.com Helped-by: Eric Sunshine sunsh...@sunshineco.com Helped-by: Jacopo Notarstefano jaco...@gmail.com Signed-off-by: Guanglin Xu mzguang...@gmail.com --- This is an implementation of the idea#2 of GSoC 2014 microproject. branch.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/branch.c b/branch.c index 723a36b..4eec0ac 100644 --- a/branch.c +++ b/branch.c @@ -49,8 +49,12 @@ static int should_setup_rebase(const char *origin) void install_branch_config(int flag, const char *local, const char *origin, const char *remote) { - const char *shortname = remote + 11; - int remote_is_branch = starts_with(remote, refs/heads/); + const char *shortname = skip_prefix(remote ,refs/heads/); + int remote_is_branch; + if (NULL == shortname) + remote_is_branch = 0; + else + remote_is_branch = 1; struct strbuf key = STRBUF_INIT; int rebasing = should_setup_rebase(origin); -- 1.9.0 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html