What's cooking in git.git (topics)
Subsystems (2)
PATCH 3/3 help (Windows): Display HTML in default browser using Windows' shell API
In reply to Steffen ProhaskaThe system's default browser for displaying HTML help pages is now used directly on Windows, instead of launching git-web--browser, which requires a Unix shell. Avoiding MSYS' bash when possible is good because it avoids potential path translation issues. In this case it is not too hard to avoid launching a shell, so let's avoid it.
The Windows-specific code is implemented in compat/mingw.c to avoid platform-specific code in the main code base. On Windows, open_html is provided as a define. If open_html is not defined, git-web--browse is used. This approach avoids platform-specific ifdefs by using per-function ifdefs. The "ifndef open_html" together with the introductory comment should sufficiently warn developers, so that they hopefully will not break this mechanism.
--- compat/mingw.c | 21 +++++++++++++++++++++ compat/mingw.h | 3 +++ help.c | 14 +++++++++++++- 3 files changed, 37 insertions(+), 1 deletions(-)
compat/mingw.c +21 -0
@@ -1017,3 +1017,24 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler) timer_fn = handler;return old; } + +static const char *make_backslash_path (const char *path) { +static char buf[PATH_MAX +1 ]; +char *c; + +if (strlcpy (buf, path,PATH_MAX ) >=PATH_MAX ) +die ("Too long path: %.*s" ,60 , path); + +for (c = buf; *c; c++) { +if (*c =='/' ) + *c ='\\' ; + } +return buf; +} + +void mingw_open_html (const char *unixpath) +{ +const char *htmlpath =make_backslash_path (unixpath); +printf ("Launching default browser to display HTML ...\n" ); +ShellExecute (NULL ,"open" , htmlpath,NULL ,"\\" ,0 ); +}
compat/mingw.h +3 -0
@@ -193,6 +193,9 @@ static inline unsigned int git_ntohl(unsigned int x)sig_handler_t mingw_signal (int sig,sig_handler_t handler);#define signal mingw_signal +void mingw_open_html (const char *path); +#define open_html mingw_open_html +/* * git specific compatibility */
help.c +13 -1
@@ -644,6 +644,18 @@ static void get_html_page_path(struct strbuf *page_path, const char *page)strbuf_addf (page_path,"%s/%s.html" , html_path, page); } +/* +* If open_html is not defined in a platform-specific way (see for +* example compat/mingw.h), we use the script web--browse to display +* HTML. +*/ +#ifndef open_html +void open_html (const char *path) +{ +execl_git_cmd ("web--browse" ,"-c" ,"help.browser" , path,NULL ); +} +#endif +static void show_html_page (const char *git_cmd) {const char *page =cmd_to_page (git_cmd);
@@ -651,7 +663,7 @@ static void show_html_page(const char *git_cmd)get_html_page_path (&page_path, page); -execl_git_cmd ("web--browse" ,"-c" ,"help.browser" , page_path.buf,NULL ); +open_html (page_path.buf); }void help_unknown_cmd (const char *cmd)
Signature · 1 line
1.5.6.1.282.gd8a0d
Re: [PATCH 3/3 FIXED] help (Windows): Display HTML in default browser using Windows' shell API
compat/mingw.c sig_handler_t mingw_signal(int sig, sig_handler_t handler) · line 1040
Quoted 12 lines · Steffen Prohaska
compat/mingw.c +6
-0@@ -1017,3 +1017,24 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler) +void mingw_open_html (const char *unixpath) +{ +const char *htmlpath =make_backslash_path (unixpath); +printf ("Launching default browser to display HTML ...\n" ); +ShellExecute (NULL ,"open" , htmlpath,NULL ,"\\" ,0 ); +}
Do you mean to have that printf() or is it a leftover debugging statement?
Re: [PATCH 3/3 FIXED] help (Windows): Display HTML in default browser using Windows' shell API
Quoted 17 lines · Junio C Hamano
compat/mingw.c sig_handler_t mingw_signal(int sig, · line 1040
Quoted 13 lines · Steffen Prohaska
compat/mingw.c +6
-0@@ -1017,3 +1017,24 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler) +void mingw_open_html (const char *unixpath) +{ +const char *htmlpath =make_backslash_path (unixpath); +printf ("Launching default browser to display HTML ...\n" ); +ShellExecute (NULL ,"open" , htmlpath,NULL ,"\\" ,0 ); +}Do you mean to have that
printf()or is it a leftover debugging statement?
I mean to have it. It takes some time until a fresh browser starts up if no browser has been running before. Impatient people (like me) could start believing that nothing would happen. But this certainly depends on your machine. I run Windows inside a virtual machine on a Laptop, which is probably rather slow compared to a desktop machine running Windows natively.
Steffen
Re: [PATCH 3/3 FIXED] help (Windows): Display HTML in default browser using Windows' shell API
Quoted 4 lines · Steffen Prohaska
Quoted 2 lines
Do you mean to have that
printf()or is it a leftover debugging statement?I mean to have it.
Ok, I was just checking. Unless other Windows users complain, will apply as-is. As you might guess, I am completely neutral on this one.
Re: [PATCH 3/3 FIXED] help (Windows): Display HTML in default browser using Windows' shell API
Zitat von Junio C Hamano <[email protected]>:
Quoted 9 lines
Quoted 4 lines · Steffen Prohaska
Quoted 2 lines
Do you mean to have that
printf()or is it a leftover debugging statement?I mean to have it.
Ok, I was just checking. Unless other Windows users complain, will apply as-is. As you might guess, I am completely neutral on this one.
I'm working on followups to this series, and it turns out to be more convenient to have system_path() in exec_cmd.c instead of path.c. It'll make sense if I resend the series with an updated version of 1/3 (instead of a patch that merely moves the function around).
-- Hannes
Re: [PATCH 3/3 FIXED] help (Windows): Display HTML in default browser using Windows' shell API
Quoted 9 lines · Johannes Sixt
Zitat von Junio C Hamano <[email protected]>:
Quoted 7 lines
Quoted 4 lines · Steffen Prohaska
Quoted 2 lines
Do you mean to have that
printf()or is it a leftover debugging statement?I mean to have it.
Quoted 7 lines
Quoted 2 lines
Ok, I was just checking. Unless other Windows users complain, will apply as-is. As you might guess, I am completely neutral on this one.
I'm working on followups to this series, and it turns out to be more convenient to have
system_path()inexec_cmd.cinstead ofpath.c. It'll make sense if I resend the series with an updated version of 1/3 (instead of a patch that merely moves the function around).
Ok, will drop these three patches and wait for replacement from yours to appear, and then we will see which ones to apply.
PATCH 1/1 Move code interpreting path relative to exec-dir to new function system_path()
From: Steffen Prohaska <[email protected]>
Expanding system paths relative to git_exec_path can be used for creating an installation that can be moved to a different directory without re-compiling. We use this approach for template_dir and the system wide gitconfig. The Windows installer (msysgit) is an example for such a setup.
This commit moves common code to a new function system_path(). System paths that are to be interpreted relative to git_exec_path are passed to system_path() and the return value is used instead of the original path. system_path() prefixes a relative path with git_exec_path and leaves absolute paths unmodified. For example, we now write
template_dir = system_path(DEFAULT_GIT_TEMPLATE_DIR);
[j6t: moved from path.c to exec_cmd.c]
--- builtin-init-db.c | 14 ++------------ config.c | 11 ++--------- exec_cmd.c | 10 ++++++++++ exec_cmd.h | 2 +- 4 files changed, 15 insertions(+), 22 deletions(-)
builtin-init-db.c +2 -12
@@ -115,18 +115,8 @@ static void copy_templates(const char *template_dir)if (!template_dir) template_dir =getenv (TEMPLATE_DIR_ENVIRONMENT ); -if (!template_dir) { -/* -* if the hard-coded template is relative, it is -* interpreted relative to the exec_dir -*/ - template_dir =DEFAULT_GIT_TEMPLATE_DIR ; -if (!is_absolute_path (template_dir)) { -struct strbuf d =STRBUF_INIT ; -strbuf_addf (&d,"%s/%s" ,git_exec_path (), template_dir); - template_dir =strbuf_detach (&d,NULL ); - } - } +if (!template_dir) + template_dir =system_path (DEFAULT_GIT_TEMPLATE_DIR );strcpy (template_path, template_dir); template_len =strlen (template_path);if (template_path[template_len-1 ] !='/' ) {
config.c +2 -9
@@ -581,15 +581,8 @@ int git_config_from_file(config_fn_t fn, const char *filename, void *data)const char *git_etc_gitconfig (void ) {static const char *system_wide; -if (!system_wide) { - system_wide =ETC_GITCONFIG ; -if (!is_absolute_path (system_wide)) { -/* interpret path relative to exec-dir */ -struct strbuf d =STRBUF_INIT ; -strbuf_addf (&d,"%s/%s" ,git_exec_path (), system_wide); - system_wide =strbuf_detach (&d,NULL ); - } - } +if (!system_wide) + system_wide =system_path (ETC_GITCONFIG );return system_wide; }
exec_cmd.c +10 -0
@@ -40,6 +40,16 @@ static const char *builtin_exec_path(void)#endif } +const char *system_path (const char *path) +{ +if (!is_absolute_path (path)) { +struct strbuf d =STRBUF_INIT ; +strbuf_addf (&d,"%s/%s" ,git_exec_path (), path); + path =strbuf_detach (&d,NULL ); + } +return path; +} +void git_set_argv_exec_path (const char *exec_path) { argv_exec_path = exec_path;
exec_cmd.h +1 -1
@@ -6,6 +6,6 @@ extern const char* git_exec_path(void);extern void setup_path (const char *);extern int execv_git_cmd (const char **argv);/* NULL terminated */ extern int execl_git_cmd (const char *cmd, ...); - +extern const char *system_path (const char *path);#endif /* GIT_EXEC_CMD_H */
Signature · 1 line
1.5.6.2.300.ga3a9
PATCH 1/1 help.c: Add support for htmldir relative to git_exec_path()
From: Steffen Prohaska <[email protected]>
If htmldir (in the Makefile) is a relative path, this path will now be interpreted relative to git_exec_path. This can be used to create an installation that can be moved to a different directory without re-compiling. The Windows installer (msysgit) is an example for such a setup.
Note that the Makefile maps htmldir to the define GIT_HTML_PATH.
--- help.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
help.c +5 -3
@@ -633,13 +633,15 @@ static void show_info_page(const char *git_cmd)static void get_html_page_path (struct strbuf *page_path,const char *page) {struct stat st; +const char *html_path =system_path (GIT_HTML_PATH );/* Check that we have a git documentation directory. */ -if (stat (GIT_HTML_PATH "/git.html" , &st) || !S_ISREG (st.st_mode)) -die ("'%s': not a documentation directory." ,GIT_HTML_PATH ); +if (stat (mkpath ("%s/git.html" , html_path), &st) + || !S_ISREG (st.st_mode)) +die ("'%s': not a documentation directory." , html_path);strbuf_init (page_path,0 ); -strbuf_addf (page_path,GIT_HTML_PATH "/%s.html" , page); +strbuf_addf (page_path,"%s/%s.html" , html_path, page); }static void show_html_page (const char *git_cmd)
Signature · 1 line
1.5.6.2.300.ga3a9
PATCH 1/1 help (Windows): Display HTML in default browser using Windows' shell API
From: Steffen Prohaska <[email protected]>
The system's default browser for displaying HTML help pages is now used directly on Windows, instead of launching git-web--browser, which requires a Unix shell. Avoiding MSYS' bash when possible is good because it avoids potential path translation issues. In this case it is not too hard to avoid launching a shell, so let's avoid it.
The Windows-specific code is implemented in compat/mingw.c to avoid platform-specific code in the main code base. On Windows, open_html is provided as a define. If open_html is not defined, git-web--browse is used. This approach avoids platform-specific ifdefs by using per-function ifdefs. The "ifndef open_html" together with the introductory comment should sufficiently warn developers, so that they hopefully will not break this mechanism.
--- compat/mingw.c | 21 +++++++++++++++++++++ compat/mingw.h | 3 +++ help.c | 14 +++++++++++++- 3 files changed, 37 insertions(+), 1 deletions(-)
compat/mingw.c +21 -0
@@ -1017,3 +1017,24 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler) timer_fn = handler;return old; } + +static const char *make_backslash_path (const char *path) { +static char buf[PATH_MAX +1 ]; +char *c; + +if (strlcpy (buf, path,PATH_MAX ) >=PATH_MAX ) +die ("Too long path: %.*s" ,60 , path); + +for (c = buf; *c; c++) { +if (*c =='/' ) + *c ='\\' ; + } +return buf; +} + +void mingw_open_html (const char *unixpath) +{ +const char *htmlpath =make_backslash_path (unixpath); +printf ("Launching default browser to display HTML ...\n" ); +ShellExecute (NULL ,"open" , htmlpath,NULL ,"\\" ,0 ); +}
compat/mingw.h +3 -0
@@ -202,6 +202,9 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler);#define PATH_SEP ';'#define PRIuMAX "I64u" +void mingw_open_html (const char *path); +#define open_html mingw_open_html +/* * helpers */
help.c +13 -1
@@ -644,6 +644,18 @@ static void get_html_page_path(struct strbuf *page_path, const char *page)strbuf_addf (page_path,"%s/%s.html" , html_path, page); } +/* +* If open_html is not defined in a platform-specific way (see for +* example compat/mingw.h), we use the script web--browse to display +* HTML. +*/ +#ifndef open_html +void open_html (const char *path) +{ +execl_git_cmd ("web--browse" ,"-c" ,"help.browser" , path,NULL ); +} +#endif +static void show_html_page (const char *git_cmd) {const char *page =cmd_to_page (git_cmd);
@@ -651,7 +663,7 @@ static void show_html_page(const char *git_cmd)get_html_page_path (&page_path, page); -execl_git_cmd ("web--browse" ,"-c" ,"help.browser" , page_path.buf,NULL ); +open_html (page_path.buf); }void help_unknown_cmd (const char *cmd)
Signature · 1 line
1.5.6.2.300.ga3a9
PATCH 1/1 Fix relative built-in paths to be relative to the command invocation
$(gitexecdir) (as defined in the Makefile) has gained another path component, but the relative paths in the MINGW section of the Makefile, which are interpreted relative to it, do not account for it.
Instead of adding another ../ in front of the path, we change the code that constructs the absolute paths to do it relative to the command's directory, which is essentially $(bindir). We do it this way because we will also allow a relative $(gitexecdir) later.
--- Makefile | 2 +- exec_cmd.c | 14 ++++++++++---- exec_cmd.h | 3 ++- git.c | 5 ++--- receive-pack.c | 2 +- shell.c | 4 ++-- upload-pack.c | 2 +- 7 files changed, 19 insertions(+), 13 deletions(-)
Makefile +1 -1
@@ -1301,7 +1301,7 @@ remove-dashes: ### Installation rules ifeq ($(firstword $(subst /, ,$(template_dir))),..) -template_instdir = $(gitexecdir)/$(template_dir) +template_instdir = $(shell cd '$(bindir_SQ)/$(template_dir_SQ)' && pwd) else template_instdir = $(template_dir) endif
exec_cmd.c +10 -4
@@ -5,6 +5,7 @@extern char **environ;static const char *argv_exec_path; +static const char *argv0_path;static const char *builtin_exec_path (void ) {
@@ -42,14 +43,19 @@ static const char *builtin_exec_path(void)const char *system_path (const char *path) { -if (!is_absolute_path (path)) { +if (!is_absolute_path (path) && argv0_path) {struct strbuf d =STRBUF_INIT ; -strbuf_addf (&d,"%s/%s" ,git_exec_path (), path); +strbuf_addf (&d,"%s/%s" , argv0_path, path); path =strbuf_detach (&d,NULL ); }return path; } +void git_set_argv0_path (const char *path) +{ + argv0_path = path; +} +void git_set_argv_exec_path (const char *exec_path) { argv_exec_path = exec_path;
@@ -84,7 +90,7 @@ static void add_path(struct strbuf *out, const char *path) } } -void setup_path (const char *cmd_path) +void setup_path (void ) {const char *old_path =getenv ("PATH" );struct strbuf new_path;
@@ -94,7 +100,7 @@ void setup_path(const char *cmd_path)add_path (&new_path, argv_exec_path);add_path (&new_path,getenv (EXEC_PATH_ENVIRONMENT ));add_path (&new_path,builtin_exec_path ()); -add_path (&new_path, cmd_path); +add_path (&new_path, argv0_path);if (old_path)strbuf_addstr (&new_path, old_path);
exec_cmd.h +2 -1
@@ -2,8 +2,9 @@#define GIT_EXEC_CMD_H extern void git_set_argv_exec_path (const char *exec_path); +extern void git_set_argv0_path (const char *path);extern const char *git_exec_path (void ); -extern void setup_path (const char *); +extern void setup_path (void );extern int execv_git_cmd (const char **argv);/* NULL terminated */ extern int execl_git_cmd (const char *cmd, ...);extern const char *system_path (const char *path);
git.c +2 -3
@@ -470,7 +470,6 @@ int main(int argc, const char **argv) {const char *cmd = argv[0 ] && *argv[0 ] ? argv[0 ] :"git-help" ;char *slash = (char *)cmd +strlen (cmd); -const char *cmd_path =NULL ;int done_alias =0 ;/*
@@ -483,7 +482,7 @@ int main(int argc, const char **argv)while (cmd <= slash && !is_dir_sep (*slash));if (cmd <= slash) { *slash++ =0 ; - cmd_path = cmd; +git_set_argv0_path (cmd); cmd = slash; }
@@ -527,7 +526,7 @@ int main(int argc, const char **argv)* environment, and the $(gitexecdir) from the Makefile at build * time. */ -setup_path (cmd_path); +setup_path ();while (1 ) {/* See if it's an internal command */
receive-pack.c +1 -1
@@ -482,7 +482,7 @@ int main(int argc, char **argv)if (!dir)usage (receive_pack_usage); -setup_path (NULL ); +setup_path ();if (!enter_repo (dir,0 ))die ("'%s': unable to chdir or not a git archive" , dir);
shell.c +2 -2
@@ -15,7 +15,7 @@ static int do_generic_cmd(const char *me, char *arg) {const char *my_argv[4 ]; -setup_path (NULL ); +setup_path ();if (!arg || !(arg =sq_dequote (arg)))die ("bad argument" );if (prefixcmp (me,"git-" ))
@@ -37,7 +37,7 @@ static int do_cvs_cmd(const char *me, char *arg)if (!arg ||strcmp (arg,"server" ))die ("git-cvsserver only handles server: %s" , arg); -setup_path (NULL ); +setup_path ();return execv_git_cmd (cvsserver_argv); }
upload-pack.c +1 -1
@@ -638,7 +638,7 @@ int main(int argc, char **argv)if (i != argc-1 )usage (upload_pack_usage); -setup_path (NULL ); +setup_path (); dir = argv[i];
Signature · 1 line
1.5.6.2.300.ga3a9
PATCH 1/1 Allow the built-in exec path to be relative to the command invocation path
If GIT_EXEC_PATH (the macro that is defined in the Makefile) is relative, it is interpreted relative to the command's invocation path, which usually is $(bindir).
The Makefile rules were written with the assumption that $(gitexecdir) is an absolute path. We introduce a separate variable that names the (absolute) installation directory.
--- Makefile | 23 +++++++++++++++-------- exec_cmd.c | 38 ++------------------------------------ 2 files changed, 17 insertions(+), 44 deletions(-)
Makefile +15 -8
@@ -1307,10 +1307,17 @@ template_instdir = $(template_dir) endif export template_instdir +ifeq ($(firstword $(subst /, ,$(gitexecdir))),..) +gitexec_instdir = $(shell cd '$(bindir_SQ)/$(gitexecdir_SQ)' && pwd) +else +gitexec_instdir = $(gitexecdir) +endif +gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir)) + install: all $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' - $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' - $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)' + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' + $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X '$(DESTDIR_SQ)$(bindir_SQ)' $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
@@ -1318,18 +1325,18 @@ ifndef NO_TCLTK $(MAKE) -C gitk-git install $(MAKE) -C git-gui install endif - if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \ + if test 'z$(bindir_SQ)' != 'z$(gitexec_instdir_SQ)'; \ then \ ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ - '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \ + '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/git$X' || \ cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ - '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \ + '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/git$X'; \ fi - $(foreach p,$(BUILT_INS), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) + $(foreach p,$(BUILT_INS), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' ;) ifneq (,$X) - $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';) + $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';) endif - ./check_bindir 'z$(bindir_SQ)' 'z$(gitexecdir_SQ)' '$(DESTDIR_SQ)$(bindir_SQ)/git-shell$X' + ./check_bindir 'z$(bindir_SQ)' 'z$(gitexec_instdir_SQ)' '$(DESTDIR_SQ)$(bindir_SQ)/git-shell$X' install-doc: $(MAKE) -C Documentation install
exec_cmd.c +2 -36
@@ -7,40 +7,6 @@ extern char **environ;static const char *argv_exec_path;static const char *argv0_path; -static const char *builtin_exec_path (void ) -{ -#ifndef __MINGW32__ -return GIT_EXEC_PATH ; -#else -int len; -char *p, *q, *sl; -static char *ep; -if (ep) -return ep; - - len =strlen (_pgmptr); -if (len <2 ) -return ep ="." ; - - p = ep =xmalloc (len+1 ); - q = _pgmptr; - sl =NULL ; -/* copy program name, turn '\\' into '/', skip last part */ -while ((*p = *q)) { -if (*q =='\\' || *q =='/' ) { - *p ='/' ; - sl = p; - } - p++, q++; - } -if (sl) - *sl ='\0' ; -else - ep[0 ] ='.' , ep[1 ] ='\0' ; -return ep; -#endif -} -const char *system_path (const char *path) {if (!is_absolute_path (path) && argv0_path) {
@@ -75,7 +41,7 @@ const char *git_exec_path(void)return env; } -return builtin_exec_path (); +return system_path (GIT_EXEC_PATH ); }static void add_path (struct strbuf *out,const char *path)
@@ -99,7 +65,7 @@ void setup_path(void)add_path (&new_path, argv_exec_path);add_path (&new_path,getenv (EXEC_PATH_ENVIRONMENT )); -add_path (&new_path,builtin_exec_path ()); +add_path (&new_path,system_path (GIT_EXEC_PATH ));add_path (&new_path, argv0_path);if (old_path)
Signature · 1 line
1.5.6.2.300.ga3a9
PATCH 1/1 Allow add_path() to add non-existent directories to the path
This function had used make_absolute_path(); but this function dies if the directory that contains the entry whose relative path was supplied in the argument does not exist. This is a problem if the argument is, for example, "../libexec/git-core", and that "../libexec" does not exist.
Since the resolution of symbolic links is not required for elements in PATH, we can fall back to using make_nonrelative_path(), which simply prepends $PWD to the path.
We have to move make_nonrelative_path() alongside make_absolute_path() in abspath.c so that git-shell can be linked. See 5b8e6f85f.
--- abspath.c | 36 ++++++++++++++++++++++++++++++++++++ exec_cmd.c | 2 +- path.c | 36 ------------------------------------ 3 files changed, 37 insertions(+), 37 deletions(-)
abspath.c +36 -0
@@ -66,3 +66,39 @@ const char *make_absolute_path(const char *path)return buf; } + +static const char *get_pwd_cwd (void ) +{ +static char cwd[PATH_MAX +1 ]; +char *pwd; +struct stat cwd_stat, pwd_stat; +if (getcwd (cwd,PATH_MAX ) ==NULL ) +return NULL ; + pwd =getenv ("PWD" ); +if (pwd &&strcmp (pwd, cwd)) { +stat (cwd, &cwd_stat); +if (!stat (pwd, &pwd_stat) && + pwd_stat.st_dev == cwd_stat.st_dev && + pwd_stat.st_ino == cwd_stat.st_ino) { +strlcpy (cwd, pwd,PATH_MAX ); + } + } +return cwd; +} + +const char *make_nonrelative_path (const char *path) +{ +static char buf[PATH_MAX +1 ]; + +if (is_absolute_path (path)) { +if (strlcpy (buf, path,PATH_MAX ) >=PATH_MAX ) +die ("Too long path: %.*s" ,60 , path); + }else { +const char *cwd =get_pwd_cwd (); +if (!cwd) +die ("Cannot determine the current working directory" ); +if (snprintf (buf,PATH_MAX ,"%s/%s" , cwd, path) >=PATH_MAX ) +die ("Too long path: %.*s" ,60 , path); + } +return buf; +}
exec_cmd.c +1 -1
@@ -50,7 +50,7 @@ static void add_path(struct strbuf *out, const char *path)if (is_absolute_path (path))strbuf_addstr (out, path);else -strbuf_addstr (out,make_absolute_path (path)); +strbuf_addstr (out,make_nonrelative_path (path));strbuf_addch (out,PATH_SEP ); }
path.c +0 -36
@@ -291,42 +291,6 @@ int adjust_shared_perm(const char *path)return 0 ; } -static const char *get_pwd_cwd (void ) -{ -static char cwd[PATH_MAX +1 ]; -char *pwd; -struct stat cwd_stat, pwd_stat; -if (getcwd (cwd,PATH_MAX ) ==NULL ) -return NULL ; - pwd =getenv ("PWD" ); -if (pwd &&strcmp (pwd, cwd)) { -stat (cwd, &cwd_stat); -if (!stat (pwd, &pwd_stat) && - pwd_stat.st_dev == cwd_stat.st_dev && - pwd_stat.st_ino == cwd_stat.st_ino) { -strlcpy (cwd, pwd,PATH_MAX ); - } - } -return cwd; -} - -const char *make_nonrelative_path (const char *path) -{ -static char buf[PATH_MAX +1 ]; - -if (is_absolute_path (path)) { -if (strlcpy (buf, path,PATH_MAX ) >=PATH_MAX ) -die ("Too long path: %.*s" ,60 , path); - }else { -const char *cwd =get_pwd_cwd (); -if (!cwd) -die ("Cannot determine the current working directory" ); -if (snprintf (buf,PATH_MAX ,"%s/%s" , cwd, path) >=PATH_MAX ) -die ("Too long path: %.*s" ,60 , path); - } -return buf; -} -const char *make_relative_path (const char *abs,const char *base) {static char buf[PATH_MAX +1 ];
Signature · 1 line
1.5.6.2.300.ga3a9
Re: [PATCH] Allow add_path() to add non-existent directories to the path
Quoted 4 lines · Johannes Sixt
abspath.c +4
-0+static const char *get_pwd_cwd (void ) +{ +static char cwd[PATH_MAX +1 ]; +char *pwd;
abspath.c const char *make_absolute_path(const char *path) · line 83
Quoted 10 lines
abspath.c +10
-0+struct stat cwd_stat, pwd_stat; +if (getcwd (cwd,PATH_MAX ) ==NULL ) +return NULL ; + pwd =getenv ("PWD" ); +if (pwd &&strcmp (pwd, cwd)) { +stat (cwd, &cwd_stat); +if (!stat (pwd, &pwd_stat) && + pwd_stat.st_dev == cwd_stat.st_dev && + pwd_stat.st_ino == cwd_stat.st_ino) { +strlcpy (cwd, pwd,PATH_MAX );
git-bash users on Windows, please test this patch. The problem is that with our custom stat implementation st_dev and st_ino are not reliable. It
works in my setup because $PWD is not set and this branch is never
entered, but with bash it makes a difference.
-- Hannes
Re: [PATCH] Allow the built-in exec path to be relative to the command invocation path
In reply to Johannes SixtHi,
Quoted 1 line · Johannes Sixt
[a patch series, with 3 patches from Steffen]
Wow. I like this demonstration how a nice patch series looks like.
Ciao,
Dscho
Re: [PATCH] Fix relative built-in paths to be relative to the command invocation
In reply to Johannes SixtHi,
Makefile remove-dashes: · line 1304
Quoted 10 lines · Johannes Sixt
Makefile +1
-1@@ -1301,7 +1301,7 @@ remove-dashes: ### Installation rules ifeq ($(firstword $(subst /, ,$(template_dir))),..) -template_instdir = $(gitexecdir)/$(template_dir) +template_instdir = $(shell cd '$(bindir_SQ)/$(template_dir_SQ)' && pwd)
What is this for? Did the original line stop working?
Quoted 35 lines
exec_cmd.c +8
-2@@ -5,6 +5,7 @@extern char **environ;static const char *argv_exec_path; +static const char *argv0_path;static const char *builtin_exec_path (void ) {@@ -42,14 +43,19 @@ static const char *builtin_exec_path(void)const char *system_path (const char *path) { -if (!is_absolute_path (path)) { +if (!is_absolute_path (path) && argv0_path) {struct strbuf d =STRBUF_INIT ; -strbuf_addf (&d,"%s/%s" ,git_exec_path (), path); +strbuf_addf (&d,"%s/%s" , argv0_path, path); path =strbuf_detach (&d,NULL ); }return path; } +void git_set_argv0_path (const char *path) +{ + argv0_path = path; +} +void git_set_argv_exec_path (const char *exec_path) { argv_exec_path = exec_path;
exec_cmd.c static void add_path(struct strbuf *out, const char *path) · line 93
Quoted 5 lines
exec_cmd.c +1
-1@@ -84,7 +90,7 @@ static void add_path(struct strbuf *out, const char *path) } } -void setup_path (const char *cmd_path) +void setup_path (void )
It seems to me that this patch would not do anything different, but with less code change, if setup_path() would set argv0_path, and not a new function was introduced.
Ciao,
Dscho
Re: [PATCH] Fix relative built-in paths to be relative to the command invocation
Zitat von Johannes Schindelin <[email protected]>:
Quoted 11 lines
Hi,
Quoted 7 lines · Johannes Sixt
Makefile +0
-0@@ -1301,7 +1301,7 @@ remove-dashes: ### Installation rules
Quoted 5 lines
Makefile remove-dashes: · line 1304
Quoted 3 lines
Makefile +1
-1ifeq ($(firstword $(subst /, ,$(template_dir))),..) -template_instdir = $(gitexecdir)/$(template_dir) +template_instdir = $(shell cd '$(bindir_SQ)/$(template_dir_SQ)' && pwd)What is this for? Did the original line stop working?
I could just have changed $(gitexecdir) to $(bindir), but in the make-execpath-relative patch we will need the normalized gitexec_instdir because its value is compared to $(bindir). So the extra $(shell...) in _this_ patch is only that the final result looks consistent.
Quoted 39 lines
exec_cmd.c static void add_path(struct strbuf *out, const char
Quoted 35 lines
exec_cmd.c +8
-2@@ -5,6 +5,7 @@extern char **environ;static const char *argv_exec_path; +static const char *argv0_path;static const char *builtin_exec_path (void ) {@@ -42,14 +43,19 @@ static const char *builtin_exec_path(void)const char *system_path (const char *path) { -if (!is_absolute_path (path)) { +if (!is_absolute_path (path) && argv0_path) {struct strbuf d =STRBUF_INIT ; -strbuf_addf (&d,"%s/%s" ,git_exec_path (), path); +strbuf_addf (&d,"%s/%s" , argv0_path, path); path =strbuf_detach (&d,NULL ); }return path; } +void git_set_argv0_path (const char *path) +{ + argv0_path = path; +} +void git_set_argv_exec_path (const char *exec_path) { argv_exec_path = exec_path;@@ -84,7 +90,7 @@ static void add_path(struct strbuf *out, const char*path)
Quoted 3 lines
exec_cmd.c +0
-0} }
Quoted 6 lines
exec_cmd.c static void add_path(struct strbuf *out, const char *path) · line 93
Quoted 2 lines
exec_cmd.c +1
-1-void setup_path (const char *cmd_path) +void setup_path (void )It seems to me that this patch would not do anything different, but with less code change, if
setup_path()would setargv0_path, and not a new function was introduced.
This is just to play a safe game. I had it that way, but I decided to have the call to the new git_set_argv0_path() early in git.c because the call to setup_path() in git.c is very late, and it could happen that we call system_path() (which needs argv0_path) before that. Although I didn't audit the code whether this really happens.
-- Hannes
Re: [PATCH] Fix relative built-in paths to be relative to the command invocation
Hi,
Quoted 16 lines · Johannes Sixt
Zitat von Johannes Schindelin <[email protected]>:
Quoted 7 lines · Johannes Sixt
Quoted 6 lines
(quoted diff) +0
-0@@ -84,7 +90,7 @@ static void add_path(struct strbuf *out, const char *path) } }Quoted 6 lines
exec_cmd.c static void add_path(struct strbuf *out, const char *path) · line 93
Quoted 2 lines
exec_cmd.c +1
-1-void setup_path (const char *cmd_path) +void setup_path (void )It seems to me that this patch would not do anything different, but with less code change, if
setup_path()would setargv0_path, and not a new function was introduced.
Quoted 5 lines
This is just to play a safe game. I had it that way, but I decided to have the call to the new
git_set_argv0_path()early ingit.cbecause the call tosetup_path()ingit.cis very late, and it could happen that we callsystem_path()(which needsargv0_path) before that. Although I didn't audit the code whether this really happens.
Well, okay... I would have rather seen it not change (since there was no bug to fix), or as a separate patch, but it's Junio's call.
Ciao,
Dscho
Re: [PATCH] Fix relative built-in paths to be relative to the command invocation
Quoted 17 lines · Johannes Schindelin
Hi,
Quoted 14 lines · Johannes Sixt
Zitat von Johannes Schindelin <[email protected]>:
Quoted 12 lines · Johannes Sixt
exec_cmd.c static void add_path(struct strbuf *out, const char · line 94
Quoted 7 lines
exec_cmd.c +1
-1@@ -84,7 +90,7 @@ static void add_path(struct strbuf *out, const char *path) } } -void setup_path (const char *cmd_path) +void setup_path (void )It seems to me that this patch would not do anything different, but with less code change, if
setup_path()would setargv0_path, and not a new function was introduced.
Quoted 8 lines
Quoted 5 lines
This is just to play a safe game. I had it that way, but I decided to have the call to the new
git_set_argv0_path()early ingit.cbecause the call tosetup_path()ingit.cis very late, and it could happen that we callsystem_path()(which needsargv0_path) before that. Although I didn't audit the code whether this really happens.Well, okay... I would have rather seen it not change (since there was no bug to fix), or as a separate patch, but it's Junio's call.
I investigated this, and, yes, there indeed are calls to system_path() before setup_path(), for example:
commit_pager_choice
setup_pager
git_config
git_etc_gitconfig
system_path(ETC_GITCONFIG)
Junio, do you want git_set_argv0_path() in a separate patch?
-- Hannes
Re: [PATCH] Fix relative built-in paths to be relative to the command invocation
Quoted 30 lines · Johannes Sixt
Quoted 17 lines · Johannes Schindelin
Hi,
Quoted 14 lines · Johannes Sixt
Zitat von Johannes Schindelin <[email protected]>:
Quoted 12 lines · Johannes Sixt
exec_cmd.c static void add_path(struct strbuf *out, const char · line 94
Quoted 7 lines
exec_cmd.c +1
-1@@ -84,7 +90,7 @@ static void add_path(struct strbuf *out, const char *path) } } -void setup_path (const char *cmd_path) +void setup_path (void )It seems to me that this patch would not do anything different, but with less code change, if
setup_path()would setargv0_path, and not a new function was introduced.Quoted 8 lines
Quoted 5 lines
This is just to play a safe game. I had it that way, but I decided to have the call to the new
git_set_argv0_path()early ingit.cbecause the call tosetup_path()ingit.cis very late, and it could happen that we callsystem_path()(which needsargv0_path) before that. Although I didn't audit the code whether this really happens.Well, okay... I would have rather seen it not change (since there was no bug to fix), or as a separate patch, but it's Junio's call.
I investigated this, and, yes, there indeed are calls to
system_path()beforesetup_path(), for example:
Quoted 7 lines
commit_pager_choice
setup_pager
git_config
git_etc_gitconfig
system_path(ETC_GITCONFIG)Junio, do you want
git_set_argv0_path()in a separate patch?
I think that would be easier to explain in the commit log what is going on, if it is a separate patch.
Re: [PATCH] Fix relative built-in paths to be relative to the command invocation
In reply to Johannes SchindelinZitat von Johannes Schindelin <[email protected]>:
Quoted 11 lines
Hi,
Quoted 7 lines · Johannes Sixt
Makefile +0
-0@@ -1301,7 +1301,7 @@ remove-dashes: ### Installation rules
Quoted 5 lines
Makefile remove-dashes: · line 1304
Quoted 3 lines
Makefile +1
-1ifeq ($(firstword $(subst /, ,$(template_dir))),..) -template_instdir = $(gitexecdir)/$(template_dir) +template_instdir = $(shell cd '$(bindir_SQ)/$(template_dir_SQ)' && pwd)What is this for? Did the original line stop working?
Hmpf! This new line doesn't work in the intended way if the installation destination does not exist. I'll have to find a better solution...
-- Hannes
cover replacement for the part of js/more-win that is in pu
The interdiff to js/more-win is below. It is mostly the changes of 1/5.
Johannes Sixt (5):
Makefile: Normalize $(bindir) and $(gitexecdir) before comparing Record the command invocation path early
Fix relative built-in paths to be relative to the command
invocation
Allow the built-in exec path to be relative to the command
invocation path
Allow add_path() to add non-existent directories to the path
Makefile | 33 +++++++++++++++++----------- abspath.c | 36 ++++++++++++++++++++++++++++++ exec_cmd.c | 54 +++++++++++---------------------------------- exec_cmd.h | 3 +- git.c | 5 +-- path.c | 36 ------------------------------ receive-pack.c | 2 +- shell.c | 4 +- upload-pack.c | 2 +- 9 files changed, 77 insertions(+), 98 deletions(-)
Makefile +11 -11
@@ -1301,14 +1301,14 @@ remove-dashes: ### Installation rules ifeq ($(firstword $(subst /, ,$(template_dir))),..) -template_instdir = $(shell cd '$(bindir_SQ)/$(template_dir_SQ)' && pwd) +template_instdir = $(bindir)/$(template_dir) else template_instdir = $(template_dir) endif export template_instdir ifeq ($(firstword $(subst /, ,$(gitexecdir))),..) -gitexec_instdir = $(shell cd '$(bindir_SQ)/$(gitexecdir_SQ)' && pwd) +gitexec_instdir = $(bindir)/$(gitexecdir) else gitexec_instdir = $(gitexecdir) endif
@@ -1325,18 +1325,18 @@ ifndef NO_TCLTK $(MAKE) -C gitk-git install $(MAKE) -C git-gui install endif - if test 'z$(bindir_SQ)' != 'z$(gitexec_instdir_SQ)'; \ - then \ - ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ - '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/git$X' || \ - cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ - '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/git$X'; \ - fi - $(foreach p,$(BUILT_INS), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' ;) ifneq (,$X) $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';) endif - ./check_bindir 'z$(bindir_SQ)' 'z$(gitexec_instdir_SQ)' '$(DESTDIR_SQ)$(bindir_SQ)/git-shell$X' + bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ + execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ + if test "z$$bindir" != "z$$execdir"; \ + then \ + ln -f "$$bindir/git$X" "$$execdir/git$X" || \ + cp "$$bindir/git$X" "$$execdir/git$X"; \ + fi && \ + { $(foreach p,$(BUILT_INS), $(RM) "$$execdir/$p" && ln "$$execdir/git$X" "$$execdir/$p" ;) } && \ + ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-shell$X" install-doc: $(MAKE) -C Documentation install
PATCH 1/5 Makefile: Normalize $(bindir) and $(gitexecdir) before comparing
The install target needs to check whether the user has opted to make $(gitexecdir) equal to $(bindir). It did so by a straight string comparison. Since we are going to allow a relative $(gitexecdir), we have to normalize paths before comparison, which we do with $(cd there && pwd).
The normalized paths are stored in shell variables. These we can now reuse in the subsequent install statements, which conveniently shortens the lines a bit.
--- Makefile | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
Makefile +9 -9
@@ -1318,18 +1318,18 @@ ifndef NO_TCLTK $(MAKE) -C gitk-git install $(MAKE) -C git-gui install endif - if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \ - then \ - ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ - '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \ - cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ - '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \ - fi - $(foreach p,$(BUILT_INS), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) ifneq (,$X) $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';) endif - ./check_bindir 'z$(bindir_SQ)' 'z$(gitexecdir_SQ)' '$(DESTDIR_SQ)$(bindir_SQ)/git-shell$X' + bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ + execdir=$$(cd '$(DESTDIR_SQ)$(gitexecdir_SQ)' && pwd) && \ + if test "z$$bindir" != "z$$execdir"; \ + then \ + ln -f "$$bindir/git$X" "$$execdir/git$X" || \ + cp "$$bindir/git$X" "$$execdir/git$X"; \ + fi && \ + { $(foreach p,$(BUILT_INS), $(RM) "$$execdir/$p" && ln "$$execdir/git$X" "$$execdir/$p" ;) } && \ + ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-shell$X" install-doc: $(MAKE) -C Documentation install
Signature · 1 line
1.5.6.3.323.g1e58
PATCH 2/5 Record the command invocation path early
We will need the command invocation path in system_path(). This path was passed to setup_path(), but system_path() can be called earlier, for example via:
main
commit_pager_choice
setup_pager
git_config
git_etc_gitconfig
system_path
Therefore, we introduce git_set_argv0_path() and call it as soon as possible.
--- exec_cmd.c | 10 ++++++++-- exec_cmd.h | 3 ++- git.c | 5 ++--- receive-pack.c | 2 +- shell.c | 4 ++-- upload-pack.c | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-)
exec_cmd.c +8 -2
@@ -5,6 +5,7 @@extern char **environ;static const char *argv_exec_path; +static const char *argv0_path;static const char *builtin_exec_path (void ) {
@@ -50,6 +51,11 @@ const char *system_path(const char *path)return path; } +void git_set_argv0_path (const char *path) +{ + argv0_path = path; +} +void git_set_argv_exec_path (const char *exec_path) { argv_exec_path = exec_path;
@@ -84,7 +90,7 @@ static void add_path(struct strbuf *out, const char *path) } } -void setup_path (const char *cmd_path) +void setup_path (void ) {const char *old_path =getenv ("PATH" );struct strbuf new_path;
@@ -94,7 +100,7 @@ void setup_path(const char *cmd_path)add_path (&new_path, argv_exec_path);add_path (&new_path,getenv (EXEC_PATH_ENVIRONMENT ));add_path (&new_path,builtin_exec_path ()); -add_path (&new_path, cmd_path); +add_path (&new_path, argv0_path);if (old_path)strbuf_addstr (&new_path, old_path);
exec_cmd.h +2 -1
@@ -2,8 +2,9 @@#define GIT_EXEC_CMD_H extern void git_set_argv_exec_path (const char *exec_path); +extern void git_set_argv0_path (const char *path);extern const char *git_exec_path (void ); -extern void setup_path (const char *); +extern void setup_path (void );extern int execv_git_cmd (const char **argv);/* NULL terminated */ extern int execl_git_cmd (const char *cmd, ...);extern const char *system_path (const char *path);
git.c +2 -3
@@ -470,7 +470,6 @@ int main(int argc, const char **argv) {const char *cmd = argv[0 ] && *argv[0 ] ? argv[0 ] :"git-help" ;char *slash = (char *)cmd +strlen (cmd); -const char *cmd_path =NULL ;int done_alias =0 ;/*
@@ -483,7 +482,7 @@ int main(int argc, const char **argv)while (cmd <= slash && !is_dir_sep (*slash));if (cmd <= slash) { *slash++ =0 ; - cmd_path = cmd; +git_set_argv0_path (cmd); cmd = slash; }
@@ -527,7 +526,7 @@ int main(int argc, const char **argv)* environment, and the $(gitexecdir) from the Makefile at build * time. */ -setup_path (cmd_path); +setup_path ();while (1 ) {/* See if it's an internal command */
receive-pack.c +1 -1
@@ -482,7 +482,7 @@ int main(int argc, char **argv)if (!dir)usage (receive_pack_usage); -setup_path (NULL ); +setup_path ();if (!enter_repo (dir,0 ))die ("'%s': unable to chdir or not a git archive" , dir);
shell.c +2 -2
@@ -15,7 +15,7 @@ static int do_generic_cmd(const char *me, char *arg) {const char *my_argv[4 ]; -setup_path (NULL ); +setup_path ();if (!arg || !(arg =sq_dequote (arg)))die ("bad argument" );if (prefixcmp (me,"git-" ))
@@ -37,7 +37,7 @@ static int do_cvs_cmd(const char *me, char *arg)if (!arg ||strcmp (arg,"server" ))die ("git-cvsserver only handles server: %s" , arg); -setup_path (NULL ); +setup_path ();return execv_git_cmd (cvsserver_argv); }
upload-pack.c +1 -1
@@ -638,7 +638,7 @@ int main(int argc, char **argv)if (i != argc-1 )usage (upload_pack_usage); -setup_path (NULL ); +setup_path (); dir = argv[i];
Signature · 1 line
1.5.6.3.323.g1e58
PATCH 3/5 Fix relative built-in paths to be relative to the command invocation
$(gitexecdir) (as defined in the Makefile) has gained another path component, but the relative paths in the MINGW section of the Makefile, which are interpreted relative to it, do not account for it.
Instead of adding another ../ in front of the path, we change the code that constructs the absolute paths to do it relative to the command's directory, which is essentially $(bindir). We do it this way because we will also allow a relative $(gitexecdir) later.
--- Makefile | 2 +- exec_cmd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Makefile +1 -1
@@ -1301,7 +1301,7 @@ remove-dashes: ### Installation rules ifeq ($(firstword $(subst /, ,$(template_dir))),..) -template_instdir = $(gitexecdir)/$(template_dir) +template_instdir = $(bindir)/$(template_dir) else template_instdir = $(template_dir) endif
exec_cmd.c +2 -2
@@ -43,9 +43,9 @@ static const char *builtin_exec_path(void)const char *system_path (const char *path) { -if (!is_absolute_path (path)) { +if (!is_absolute_path (path) && argv0_path) {struct strbuf d =STRBUF_INIT ; -strbuf_addf (&d,"%s/%s" ,git_exec_path (), path); +strbuf_addf (&d,"%s/%s" , argv0_path, path); path =strbuf_detach (&d,NULL ); }return path;
Signature · 1 line
1.5.6.3.323.g1e58
PATCH 4/5 Allow the built-in exec path to be relative to the command invocation path
If GIT_EXEC_PATH (the macro that is defined in the Makefile) is relative, it is interpreted relative to the command's invocation path, which usually is $(bindir).
The Makefile rules were written with the assumption that $(gitexecdir) is an absolute path. We introduce a separate variable that names the (absolute) installation directory.
--- Makefile | 15 +++++++++++---- exec_cmd.c | 38 ++------------------------------------ 2 files changed, 13 insertions(+), 40 deletions(-)
Makefile +11 -4
@@ -1307,10 +1307,17 @@ template_instdir = $(template_dir) endif export template_instdir +ifeq ($(firstword $(subst /, ,$(gitexecdir))),..) +gitexec_instdir = $(bindir)/$(gitexecdir) +else +gitexec_instdir = $(gitexecdir) +endif +gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir)) + install: all $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' - $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' - $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)' + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' + $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X '$(DESTDIR_SQ)$(bindir_SQ)' $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
@@ -1319,10 +1326,10 @@ ifndef NO_TCLTK $(MAKE) -C git-gui install endif ifneq (,$X) - $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';) + $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';) endif bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ - execdir=$$(cd '$(DESTDIR_SQ)$(gitexecdir_SQ)' && pwd) && \ + execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ if test "z$$bindir" != "z$$execdir"; \ then \ ln -f "$$bindir/git$X" "$$execdir/git$X" || \
exec_cmd.c +2 -36
@@ -7,40 +7,6 @@ extern char **environ;static const char *argv_exec_path;static const char *argv0_path; -static const char *builtin_exec_path (void ) -{ -#ifndef __MINGW32__ -return GIT_EXEC_PATH ; -#else -int len; -char *p, *q, *sl; -static char *ep; -if (ep) -return ep; - - len =strlen (_pgmptr); -if (len <2 ) -return ep ="." ; - - p = ep =xmalloc (len+1 ); - q = _pgmptr; - sl =NULL ; -/* copy program name, turn '\\' into '/', skip last part */ -while ((*p = *q)) { -if (*q =='\\' || *q =='/' ) { - *p ='/' ; - sl = p; - } - p++, q++; - } -if (sl) - *sl ='\0' ; -else - ep[0 ] ='.' , ep[1 ] ='\0' ; -return ep; -#endif -} -const char *system_path (const char *path) {if (!is_absolute_path (path) && argv0_path) {
@@ -75,7 +41,7 @@ const char *git_exec_path(void)return env; } -return builtin_exec_path (); +return system_path (GIT_EXEC_PATH ); }static void add_path (struct strbuf *out,const char *path)
@@ -99,7 +65,7 @@ void setup_path(void)add_path (&new_path, argv_exec_path);add_path (&new_path,getenv (EXEC_PATH_ENVIRONMENT )); -add_path (&new_path,builtin_exec_path ()); +add_path (&new_path,system_path (GIT_EXEC_PATH ));add_path (&new_path, argv0_path);if (old_path)
Signature · 1 line
1.5.6.3.323.g1e58
PATCH 5/5 Allow add_path() to add non-existent directories to the path
This function had used make_absolute_path(); but this function dies if the directory that contains the entry whose relative path was supplied in the argument does not exist. This is a problem if the argument is, for example, "../libexec/git-core", and that "../libexec" does not exist.
Since the resolution of symbolic links is not required for elements in PATH, we can fall back to using make_nonrelative_path(), which simply prepends $PWD to the path.
We have to move make_nonrelative_path() alongside make_absolute_path() in abspath.c so that git-shell can be linked. See 5b8e6f85f.
--- abspath.c | 36 ++++++++++++++++++++++++++++++++++++ exec_cmd.c | 2 +- path.c | 36 ------------------------------------ 3 files changed, 37 insertions(+), 37 deletions(-)
abspath.c +36 -0
@@ -66,3 +66,39 @@ const char *make_absolute_path(const char *path)return buf; } + +static const char *get_pwd_cwd (void ) +{ +static char cwd[PATH_MAX +1 ]; +char *pwd; +struct stat cwd_stat, pwd_stat; +if (getcwd (cwd,PATH_MAX ) ==NULL ) +return NULL ; + pwd =getenv ("PWD" ); +if (pwd &&strcmp (pwd, cwd)) { +stat (cwd, &cwd_stat); +if (!stat (pwd, &pwd_stat) && + pwd_stat.st_dev == cwd_stat.st_dev && + pwd_stat.st_ino == cwd_stat.st_ino) { +strlcpy (cwd, pwd,PATH_MAX ); + } + } +return cwd; +} + +const char *make_nonrelative_path (const char *path) +{ +static char buf[PATH_MAX +1 ]; + +if (is_absolute_path (path)) { +if (strlcpy (buf, path,PATH_MAX ) >=PATH_MAX ) +die ("Too long path: %.*s" ,60 , path); + }else { +const char *cwd =get_pwd_cwd (); +if (!cwd) +die ("Cannot determine the current working directory" ); +if (snprintf (buf,PATH_MAX ,"%s/%s" , cwd, path) >=PATH_MAX ) +die ("Too long path: %.*s" ,60 , path); + } +return buf; +}
exec_cmd.c +1 -1
@@ -50,7 +50,7 @@ static void add_path(struct strbuf *out, const char *path)if (is_absolute_path (path))strbuf_addstr (out, path);else -strbuf_addstr (out,make_absolute_path (path)); +strbuf_addstr (out,make_nonrelative_path (path));strbuf_addch (out,PATH_SEP ); }
path.c +0 -36
@@ -291,42 +291,6 @@ int adjust_shared_perm(const char *path)return 0 ; } -static const char *get_pwd_cwd (void ) -{ -static char cwd[PATH_MAX +1 ]; -char *pwd; -struct stat cwd_stat, pwd_stat; -if (getcwd (cwd,PATH_MAX ) ==NULL ) -return NULL ; - pwd =getenv ("PWD" ); -if (pwd &&strcmp (pwd, cwd)) { -stat (cwd, &cwd_stat); -if (!stat (pwd, &pwd_stat) && - pwd_stat.st_dev == cwd_stat.st_dev && - pwd_stat.st_ino == cwd_stat.st_ino) { -strlcpy (cwd, pwd,PATH_MAX ); - } - } -return cwd; -} - -const char *make_nonrelative_path (const char *path) -{ -static char buf[PATH_MAX +1 ]; - -if (is_absolute_path (path)) { -if (strlcpy (buf, path,PATH_MAX ) >=PATH_MAX ) -die ("Too long path: %.*s" ,60 , path); - }else { -const char *cwd =get_pwd_cwd (); -if (!cwd) -die ("Cannot determine the current working directory" ); -if (snprintf (buf,PATH_MAX ,"%s/%s" , cwd, path) >=PATH_MAX ) -die ("Too long path: %.*s" ,60 , path); - } -return buf; -} -const char *make_relative_path (const char *abs,const char *base) {static char buf[PATH_MAX +1 ];
Signature · 1 line
1.5.6.3.323.g1e58
Re: [PATCH 0/5] replacement for the part of js/more-win that is in pu
In reply to Johannes SixtQuoted 11 lines · Johannes Sixt
The interdiff to js/more-win is below. It is mostly the changes of 1/5.
Johannes Sixt (5):
Makefile: Normalize $(bindir) and $(gitexecdir) before comparing Record the command invocation path early
Fix relative built-in paths to be relative to the command
invocation
Allow the built-in exec path to be relative to the command
invocation path
Allowadd_path()to add non-existent directories to the path
I retract this series and also the earlier version (the part that is in pu).
If I had done due diligence, I could have found out earlier that it does not solve the problem it tried to solve. Appologies for the noise. :-(
The series tries to derive the exec-path from argv[0] (if the built-in path is relative). But if a command is invoked from CMD on Windows, argv[0] doesn't have a path, there is only the program name, "git.exe". In the past, we relied on the global variable _pgmptr (only Windows's C runtime has this), which does contain the full path, and if we set
gitexecdir = $(bindir)
in the Makefile, then we get a working git.exe, but we put back all commands into $PATH.
-- Hannes
Re: [PATCH 1/2] help.c: Add support for htmldir relative to git_exec_path()
In reply to Steffen ProhaskaZitat von Steffen Prohaska <[email protected]>:
Quoted 23 lines · Johannes Schindelin
Quoted 10 lines · Junio C Hamano
Quoted 3 lines
Could you check if there are copy-and-pasted duplicated code you can factor out before continuing this direction?
Note also that Hannes tried very hard to get rid of those ugly "#ifdef __MINGW32__"s by declaring/overriding functions in
git-compat-util.h.I think that is such a good practice that we should not stop here.
I'll send three patches that address Junio's and Dscho's comments:
[PATCH 1/3] Move code interpreting path relative to exec-dir to new
functionsystem_path()
[PATCH 2/3]help.c: Add support for htmldir relative togit_exec_path()
[PATCH 3/3] help (Windows): Display HTML in default browser using
Windows' shell API
Quoted 4 lines
Hannes,
the patches I'll send probably conflict with your planned work onGIT_EXEC_PATHthat has been discussed on the msysgit list. I think you could built on my series and modifysystem_path().
Thanks. I haven't done a lot in that direction, yet, so your patches will be helpful.
But according to the conclusion of our recent discussion
http://thread.gmane.org/gmane.comp.version-control.msysgit/2633/focus=2669
I shall modify system_path() to construct paths relative to the git executable, which is essentially Makefile's $(bindir), not git_exec_path().
-- Hannes
Re: [PATCH 04/12] Avoid calling signal(SIGPIPE, ..) for MinGW builds.
In reply to Steffen ProhaskaQuoted 3 lines · Steffen Prohaska
From: Marius Storm-Olsen <[email protected]>
SIGPIPE isn't supported in MinGW.
Shouldn't #ifdef be on SIGPIPE not on __MINGW32__?
Quoted 9 lines
builtin-verify-tag.c +2
-0@@ -100,9 +100,11 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix) i++; } +#ifndef __MINGW32__/* sometimes the program was terminated because this signal * was received in the process of writing the gpg input: */ signal (SIGPIPE ,SIG_IGN ); +#endif
Re: [PATCH 04/12] Avoid calling signal(SIGPIPE, ..) for MinGW builds.
Junio C Hamano said the following on 02.07.2008 11:22:
Quoted 7 lines
Quoted 3 lines · Steffen Prohaska
From: Marius Storm-Olsen <[email protected]>
SIGPIPE isn't supported in MinGW.
Shouldn't #ifdef be on SIGPIPE not on
__MINGW32__?
That's certainly a good suggestion. :-)
Signature · 2 lines
.marius [@] storm-olsen [.com] 'if you know what you're doing, it's not research'
Re: [PATCH 04/12] Avoid calling signal(SIGPIPE, ..) for MinGW builds.
Quoted 8 lines · Marius Storm-Olsen
Junio C Hamano said the following on 02.07.2008 11:22:
Quoted 5 lines
Quoted 3 lines · Steffen Prohaska
From: Marius Storm-Olsen <[email protected]>
SIGPIPE isn't supported in MinGW.
Shouldn't #ifdef be on SIGPIPE not on
__MINGW32__?That's certainly a good suggestion. :-)
I reverted this in 4msysgit and will remove the patch from the series.
Steffen
Re: [msysGit] [PATCH 03/12] MinGW: Convert CR/LF to LF in tag signatures
In reply to Steffen ProhaskaQuoted 30 lines · Steffen Prohaska
From: Johannes Schindelin <[email protected]>
On Windows, gpg outputs CR/LF signatures. But since the tag messages are already stripped of the CR by
stripspace(), it is arguably nicer to do the same for the tag signature. Actually, this patch does not look for CR/LF, but strips all CRs from the signature.[ spr: ported code to use strbuf ]
Signed-off-by Johannes Schindelin <[email protected]>Signed-off-by Steffen Prohaska <[email protected]>--- builtin-tag.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)builtin-tag.c +6
-0@@ -241,6 +241,20 @@ static int do_sign(struct strbuf *buffer)if (finish_command (&gpg) || !len || len <0 )return error ("gpg failed to sign the tag" ); +#ifdef __MINGW32__ +/* strip CR from the line endings */ + { +int i, j; +for (i = j =0 ; i < buffer->len; i++) +if (buffer->buf[i] !='\r' ) {
builtin-tag.c static int do_sign(struct strbuf *buffer) · line 259
Quoted 10 lines
builtin-tag.c +8
-0+if (i != j) + buffer->buf[j] = buffer->buf[i]; + j++; + } +strbuf_setlen (buffer, j); + } +#endif +return 0 ; }
Do we need the #ifdef __MINGW32__? Can't we just strip CRs unconditionally? It shouldn't hurt on Unix anyway.
-- Hannes
Re: [PATCH 03/12] MinGW: Convert CR/LF to LF in tag signatures
Hi,
Quoted 36 lines · Johannes Sixt
Quoted 35 lines · Steffen Prohaska
From: Johannes Schindelin <[email protected]>
On Windows, gpg outputs CR/LF signatures. But since the tag messages are already stripped of the CR by
stripspace(), it is arguably nicer to do the same for the tag signature. Actually, this patch does not look for CR/LF, but strips all CRs from the signature.[ spr: ported code to use strbuf ]
Signed-off-by Johannes Schindelin <[email protected]>Signed-off-by Steffen Prohaska <[email protected]>--- builtin-tag.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)builtin-tag.c +11
-0@@ -241,6 +241,20 @@ static int do_sign(struct strbuf *buffer)if (finish_command (&gpg) || !len || len <0 )return error ("gpg failed to sign the tag" ); +#ifdef __MINGW32__ +/* strip CR from the line endings */ + { +int i, j; +for (i = j =0 ; i < buffer->len; i++) +if (buffer->buf[i] !='\r' ) { +if (i != j) + buffer->buf[j] = buffer->buf[i]; + j++; + } +strbuf_setlen (buffer, j);
Quoted 8 lines
builtin-tag.c static int do_sign(struct strbuf *buffer) · line 259
Quoted 5 lines
builtin-tag.c +3
-0+ } +#endif +return 0 ; }Do we need the #ifdef
__MINGW32__? Can't we just strip CRs unconditionally? It shouldn't hurt on Unix anyway.
I agree, and I would even like to refactor this into its own function. Probably even move it to strbuf.[ch].
Ciao,
Dscho
PATCH 1/1 Convert CR/LF to LF in tag signatures
In reply to Johannes SixtFrom: Johannes Schindelin <[email protected]>
On Windows, gpg outputs CR/LF signatures. But since the tag messages are already stripped of the CR by stripspace(), it is arguably nicer to do the same for the tag signature. Actually, this patch does not look for CR/LF, but strips all CRs from the signature. It does so not only on Windows but on all platforms to keep the code simpler.
[ spr: ported code to use strbuf ]
--- builtin-tag.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
builtin-tag.c +10 -0
@@ -202,6 +202,7 @@ static int do_sign(struct strbuf *buffer)const char *args[4 ];char *bracket;int len; +int i, j;if (!*signingkey) { if (strlcpy(signingkey, git_committer_info(IDENT_ERROR_ON_NO_NAME),
@@ -241,6 +242,15 @@ static int do_sign(struct strbuf *buffer)if (finish_command (&gpg) || !len || len <0 )return error ("gpg failed to sign the tag" ); +/* Strip CR from the line endings, in case we are on Windows. */ +for (i = j =0 ; i < buffer->len; i++) +if (buffer->buf[i] !='\r' ) { +if (i != j) + buffer->buf[j] = buffer->buf[i]; + j++; + } +strbuf_setlen (buffer, j); +return 0 ; }
Signature · 1 line
1.5.6.1.282.gd8a0d
Re: [PATCH 02/12] Do not complain about "no common commits" in an empty repo
In reply to Steffen ProhaskaQuoted 4 lines · Steffen Prohaska
From: Johannes Schindelin <[email protected]>
If the repo is empty, we know that already, thank you very much. So shut fetch-pack up about that case.
Two complaints.
* What does this have to do with Windows port? Please don't hide a general interface change in a larger and mostly unrelated topic.
* Do you think people can tell without reading the code in larger context outside the patch and this commit log text if you are talking about the case you fetch _into_ an empty repository, or if you are attempting to fetch _from_ an empty repository, or what? Please try to be a bit easier for _readers_. Being more redundant and verbose is better than being too concise.
About the first point, "no common commits" is just a friendly reminder and not even an error. When you see it, you will learn to expect looooooooong download session.
I personally happen to agree with the logic of this patch, though --- if you are fetching into an empty repository, you would already expect that the download is as big as the other end anyway, so you would not need to be further reminded about that.
But that is just one-man's opinion. Maybe somebody knows a reason why I am (and the logic I am agreeing with is) wrong. Maybe not. So make the "remainder of Windows port" series 11 commits, and send this as a general interface fix via the normal channel to be discussed, please.
Re: [PATCH 02/12] Do not complain about "no common commits" in an empty repo
Quoted 8 lines · Junio C Hamano
Quoted 4 lines · Steffen Prohaska
From: Johannes Schindelin <[email protected]>
If the repo is empty, we know that already, thank you very much. So shut fetch-pack up about that case.
Two complaints.
You are right, although I didn't intend to "hide" the patch. I just went through the differences between the mainline and 4msysgit and collected a patch series with all changes I found. I sent this series to the list, so that the remaining differences do not get lost unrecognized.
I didn't mean to bother you with incomplete patches. Maybe I should have made my intention clearer by prefixing the subject lines with WIP (or something similar). Apologies.
Quoted 2 lines
* What does this have to do with Windows port? Please don't hide a general interface change in a larger and mostly unrelated topic.
I remember that users of msysgit's net installer complaint about this warning. The warning appeared as part of the output of a sequence of automatically executed commands. Without context, the users did not understand what the warning means.
Quoted 20 lines
* Do you think people can tell without reading the code in larger context outside the patch and this commit log text if you are talking
about the
case you fetch _into_ an empty repository, or if you are
attempting to
fetch _from_ an empty repository, or what? Please try to be a bit easier for _readers_. Being more redundant and verbose is better
than
being too concise.About the first point, "no common commits" is just a friendly reminder and not even an error. When you see it, you will learn to expect looooooooong download session.
I personally happen to agree with the logic of this patch, though --- if
you are fetching into an empty repository, you would already expect that the download is as big as the other end anyway, so you would not need to be further reminded about that.
Quoted 4 lines
But that is just one-man's opinion. Maybe somebody knows a reason why I am (and the logic I am agreeing with is) wrong. Maybe not. So make the "remainder of Windows port" series 11 commits, and send this as a general interface fix via the normal channel to be discussed, please.
Dscho, will you send it? You are the original author.
Steffen
Re: [PATCH 02/12] Do not complain about "no common commits" in an empty repo
Hi,
Quoted 1 line · Steffen Prohaska
Dscho, will you send it? You are the original author.
Done,
Dscho
Re: [PATCH 01/12] Fake reencoding success under NO_ICONV instead of returning NULL.
In reply to Steffen ProhaskaQuoted 10 lines · Steffen Prohaska
From: Johannes Sixt <[email protected]>
git-am when invoked from git-rebase seems to rely on successful conversion.
utf8.h +0
-0@@ -10,10 +10,6 @@ int is_encoding_utf8(const char *name);
utf8.h int is_encoding_utf8(const char *name); · line 15
Quoted 10 lines
utf8.h +0
-3int print_wrapped_text (const char *text,int indent,int indent2,int len); -#ifndef NO_ICONV char *reencode_string (const char *in,const char *out_encoding,const char *in_encoding); -#else -#define reencode_string (a,b,c) NULL -#endif #endif
I don't think that this is still needed. It dates back to the origins of mingw.git, at which time I did not have a working libiconv.
-- Hannes
Re: How to reduce remaining differences to 4msysgit? (was What's cooking in git.git (topics))
In reply to Johannes SixtHi:
Quoted 10 lines · Johannes Sixt
Quoted 4 lines · Steffen Prohaska
Quoted 1 line · Junio C Hamano
* MinGW will be in.
How should we proceed to get rid of the differences?
...
Then there are the extra patches in 4msysgit. From my POV, they are not _required_ because I can appearently work with git on Windows without them. I think some of them are not necessary. Can we go through them again?
As one of the extra patches in 4msysgit, there is the cca/git.el branch [1] which I contributed [2] previously for Emacs git.el users on Windows. However I have not gotten any feedback whatsoever, so perhaps parking it in 4msysgit is not appropriate. I plan to separately to host these patch(es). Please ignore it or remove it at your convenience.
References:
[1] http://repo.or.cz/w/git/mingw/4msysgit.git?a=shortlog;h=refs/heads/cca/git.el
[2] http://thread.gmane.org/gmane.comp.version-control.msysgit/2140
Best regards,
Clifford Caoile
Quoted 4 lines · Junio C Hamano
* js/apply-recount (Fri Jun 27 18:43:09 2008 +0100) 1 commit
+ Allow git-apply to recount the lines in a hunk (AKA recountdiff)A good ingredient for implementing "apply --edit".
Thomas,
Now that this is in next, maybe it is a good time to repost the add--interactive patch (it should be independent of Dscho's 2/2 "add -e" patch).
-Peff
PATCH 1/1 git-add--interactive: manual hunk editing mode
Adds a new option 'e' to the 'add -p' command loop that lets you edit the current hunk in your favourite editor.
If the resulting patch applies cleanly, the edited hunk will immediately be marked for staging. If it does not apply cleanly, you will be given an opportunity to edit again. If all lines of the hunk are removed, then the edit is aborted and the hunk is left unchanged.
Applying the changed hunk(s) relies on Johannes Schindelin's new --recount option for git-apply.
Note that the "real patch" test intentionally uses
(echo e; echo n; echo d) | git add -p
even though the 'n' and 'd' are superfluous at first sight. They serve to get out of the interaction loop if git add -p wrongly concludes the patch does not apply.
Many thanks to Jeff King <[email protected]> for lots of help and suggestions.
---
Quoted 3 lines · Jeff King
Now that this is in next, maybe it is a good time to repost the add--interactive patch (it should be independent of Dscho's 2/2 "add -e" patch).
It is independent, so I suppose you're right. (Dscho mentioned in passing he might repost "add -e" himself.)
- Thomas
Documentation/git-add.txt | 1 + git-add--interactive.perl | 124 +++++++++++++++++++++++++++++++++++++++++++- t/t3701-add-interactive.sh | 67 ++++++++++++++++++++++++ 3 files changed, 191 insertions(+), 1 deletions(-)
Documentation/git-add.txt +1 -0
@@ -246,6 +246,7 @@ patch:: k - leave this hunk undecided, see previous undecided hunk K - leave this hunk undecided, see previous hunk s - split the current hunk into smaller hunks + e - manually edit the current hunk ? - print help + After deciding the fate for all hunks, if there is any hunk
git-add--interactive.perl +123 -1
172 lines not on this page · raw message
t/t3701-add-interactive.sh +67 -0
73 lines not on this page · raw message
Signature · 1 line
1.5.4.5
Re: [PATCH] git-add--interactive: manual hunk editing mode
git-add--interactive.perl line 5
Quoted 9 lines · Thomas Rast
git-add--interactive.perl +1
-0@@ -2,6 +2,7 @@ use strict; use Git; +use File::Temp;
People with minimum Perl installation should still be able to use "add -i" as long as they do not use 'e' subcommand, shouldn't they? Shouldn't we do something like:
my $can_use_temp = eval {
require File::Temp;
1;
};and disable 'e' subcommand unless $can_use_temp?
Quoted 4 lines
git-add--interactive.perl +4
-0+sub edit_hunk_manually { + my ($oldtext) = @_; + + my $t = File::Temp->new(
git-add--interactive.perl sub coalesce_overlapping_hunks { · line 809
Quoted 10 lines
git-add--interactive.perl +10
-0+ TEMPLATE => $repo->repo_path . "/git-hunk-edit.XXXXXX", + SUFFIX => '.diff' + ); + print $t "# Manual hunk edit mode -- see bottom for a quick guide\n"; + print $t @$oldtext; + print $t <<EOF; +# --- +# To remove '-' lines, make them ' ' lines (context). +# To remove '+' lines, delete them. +# Lines starting with # will be removed.
Don't you want to say "Do not touch lines that begin with ' '"?
git-add--interactive.perl sub coalesce_overlapping_hunks { · line 835
Quoted 4 lines
git-add--interactive.perl +4
-0+ # Reinsert the first hunk header if the user accidentally deleted it + if ($newtext[0] !~ /^@/) { + unshift @newtext, $oldtext->[0]; + }
Hmm, perhaps not even giving the "@@ ... @@" lines to the editor would be a more robust solution?
git-add--interactive.perl sub coalesce_overlapping_hunks { · line 845
Quoted 7 lines
git-add--interactive.perl +7
-0+sub diff_applies { + my $fh; + open $fh, '| git apply --recount --cached --check'; + for my $h (@_) { + print $fh @{$h->{TEXT}}; + } + return close $fh;
Have to wonder where the potential error message would go, and if it would confuse the end users...
git-add--interactive.perl sub patch_update_file { · line 1130
Quoted 10 lines
git-add--interactive.perl +2
-1@@ -1002,7 +1123,8 @@ sub patch_update_file { if (@result) { my $fh; - open $fh, '| git apply --cached'; + open $fh, '| git apply --cached' + . ($need_recount ? ' --recount' : ''); for (@{$head->{TEXT}}, @result) { print $fh $_; }
I recall that the original "add--interactive" carefully counted numbers in hunks it reassembles (as it can let you split and then you can choose to use both parts, which requires it to merge overlapping hunks back), but if you are going to use --recount anyway, perhaps we can discard that logic? It may make the patch application less robust, though. I dunno.
An alternative, and probably more robust, approach would be to recount what we have in @{$mode->{TEXT}}, after letting the user edit some of them, so that "add--interactive" still knows what it is doing after applying your patch without having to rely on "apply --recount".
Re: [PATCH] git-add--interactive: manual hunk editing mode
Quoted 6 lines · Junio C Hamano
Quoted 1 line
+use
File::Temp;People with minimum Perl installation should still be able to use "add -i" as long as they do not use 'e' subcommand, shouldn't they? Shouldn't we do something like:
Quoted 6 lines
my $can_use_temp = eval { require File::Temp; 1; };and disable 'e' subcommand unless $can_use_temp?
According to Module::CoreList, File::Temp has shipped as part of core perl since 5.006001. "add -i" doesn't work with perl < 5.6 already due to things like 3-argument open.
So if the problem is "old perl", I don't think it is an issue. Are there modern perl installations in the wild that don't have File::Temp?
-Peff
Re: [PATCH] git-add--interactive: manual hunk editing mode
Quoted 6 lines · Jeff King
According to
Module::CoreList,File::Temphas shipped as part of core perl since 5.006001. "add -i" doesn't work with perl < 5.6 already due to things like 3-argument open.So if the problem is "old perl", I don't think it is an issue. Are there modern perl installations in the wild that don't have
File::Temp?
The thing is, I think I heard quite similar explanation why Test::More is safe to use when the patch to add t/t9700 was submit. Then what happened?
Re: [PATCH] git-add--interactive: manual hunk editing mode
Quoted 5 lines · Junio C Hamano
Quoted 2 lines
So if the problem is "old perl", I don't think it is an issue. Are there modern perl installations in the wild that don't have
File::Temp?The thing is, I think I heard quite similar explanation why
Test::Moreis safe to use when the patch to add t/t9700 was submit. Then what happened?
ISTR the Test::More problem was reported by Linus, who is a Fedora user? I tried searching for any reasonable information on which of the core perl modules are installed by default on Fedora systems, but didn't come up with anything useful.
I really have no clue as to what is out there, and I suspect we must either play it totally safe, or push the limits and wait for people to complain about breakage.
-Peff
Re: [PATCH] git-add--interactive: manual hunk editing mode
Hi,
Quoted 10 lines · Jeff King
Quoted 7 lines · Junio C Hamano
Quoted 3 lines
So if the problem is "old perl", I don't think it is an issue. Are there modern perl installations in the wild that don't have
File::Temp?The thing is, I think I heard quite similar explanation why
Test::Moreis safe to use when the patch to add t/t9700 was submit. Then what happened?
Quoted 8 lines
ISTR the
Test::Moreproblem was reported by Linus, who is a Fedora user? I tried searching for any reasonable information on which of the core perl modules are installed by default on Fedora systems, but didn't come up with anything useful.I really have no clue as to what is out there, and I suspect we must either play it totally safe, or push the limits and wait for people to complain about breakage.
I wonder why bother trying to import things when you do not need them to begin with! I mean, it is _obvious_ that in this case, we want .git/ to be writable _anyway_, so why not stick with a fixed name in that?
Ciao,
Dscho
Re: [PATCH] git-add--interactive: manual hunk editing mode
Quoted 3 lines · Johannes Schindelin
I wonder why bother trying to import things when you do not need them to begin with! I mean, it is _obvious_ that in this case, we want .git/ to be writable _anyway_, so why not stick with a fixed name in that?
Good suggestion -- I love that simplicity. Thomas?
Re: [PATCH] git-add--interactive: manual hunk editing mode
In reply to Junio C HamanoQuoted 4 lines · Junio C Hamano
People with minimum Perl installation should still be able to use "add -i" as long as they do not use 'e' subcommand, shouldn't they? Shouldn't we do something like:
[...]
Quoted 1 line
and disable 'e' subcommand unless $can_use_temp?
I can just call the temporary editing file something constant, like the commit message already is. I don't care much about that point, and honestly assumed File::Temp came with every Perl (it's in perl-base here).
Quoted 5 lines
git-add--interactive.perl sub coalesce_overlapping_hunks { · line 809
Quoted 3 lines
git-add--interactive.perl +3
-0+# To remove '-' lines, make them ' ' lines (context). +# To remove '+' lines, delete them. +# Lines starting with # will be removed.Don't you want to say "Do not touch lines that begin with ' '"?
Why? You can make them '-' instead if you really want to :-)
Quoted 4 lines
git-add--interactive.perl sub coalesce_overlapping_hunks { · line 832
Quoted 1 line
git-add--interactive.perl +1
-0+ # Reinsert the first hunk header if the user accidentally deleted itHmm, perhaps not even giving the "@@ ... @@" lines to the editor would be a more robust solution?
I originally left it there because Emacs automatically recounts the header, and it also reminds the user of the function the hunk applies to.
Quoted 4 lines
git-add--interactive.perl sub coalesce_overlapping_hunks { · line 841
Quoted 1 line
git-add--interactive.perl +1
-0+ open $fh, '| git apply --recount --cached --check';Have to wonder where the potential error message would go, and if it would confuse the end users...
To the terminal. If we eat that error message, the user gets absolutely no indication as to _what_ might be wrong with the edited patch, so I kind of deliberately left it there.
Then again the message from git-apply is not exactly transparent either.
Quoted 4 lines
I recall that the original "add--interactive" carefully counted numbers in hunks it reassembles (as it can let you split and then you can choose to use both parts, which requires it to merge overlapping hunks back), but if you are going to use --recount anyway, perhaps we can discard that logic?
We briefly talked about that[1], but Jeff thought it should be a separate patch, and I agree. Can't sneakily rip out two dozen lines of otherwise unrelated code in my feature patch, can I?
Quoted 1 line
It may make the patch application less robust, though. I dunno.
I've become convinced it can't, apart from making it less likely to trip over bugs in the script itself of course.
Quoted 4 lines
An alternative, and probably more robust, approach would be to recount what we have in @{$mode->{TEXT}}, after letting the user edit some of them, so that "add--interactive" still knows what it is doing after applying your patch without having to rely on "apply --recount".
You lost me here. Why recount the mode part?
If you mean the _hunk_ headers, that's what the first three versions of this patch did, at the expense of a lot of code complication (and now that git-apply implements --recount, actually _duplication_).
- Thomas
[1] http://article.gmane.org/gmane.comp.version-control.git/84698
Signature · 2 lines
Thomas Rast [email protected]
Re: [PATCH] git-add--interactive: manual hunk editing mode
Quoted 9 lines · Thomas Rast
Junio C Hamano wrote:
...Quoted 5 lines
git-add--interactive.perl sub coalesce_overlapping_hunks { · line 809
Quoted 3 lines
git-add--interactive.perl +3
-0+# To remove '-' lines, make them ' ' lines (context). +# To remove '+' lines, delete them. +# Lines starting with # will be removed.Don't you want to say "Do not touch lines that begin with ' '"?
Why? You can make them '-' instead if you really want to :-)
If you change '-' to ' ', or remove '+', then you are temporarily reverting the change you have made since HEAD to your working tree copy. If you do not change anything, you are taking something that was in your working tree copy. Both are simpler and easier to explain operations.
Once you allow changing ' ' to '-' or insert '+' at random places, however, you are letting the user commit lines that is neither from HEAD nor from the working tree.
If the goal of "e" action in "add -i" is to support that operation (I am not saying that it is a bad thing to support), you have to deal with an issue that your patch so far did not have to deal with, and it would require a much larger change to the way how "add -i" is structured.
When you give the user a hunk like this to edit:
@@ -4,9 +4,6 @@ GIT v1.6.0 Release Notes
User visible changes
--------------------
-[[Note that none of these are not merged to 'master' as of this writing -but they will be before 1.6.0 happens]]
-
With the default Makefile settings, most of the programs are now installed outside your $PATH, except for "git", "gitk", "git-gui" and some server side programs that need to be accessible for technical
the user may want to change the line before the line that has "User visible changes", or the lines toward the end of the hunk. The user may want to edit the line that ends with "for technical" for rewording the sentence, but the rest of the sentence is outside the context, and these lines somehow needs to be summoned to the editing session for completing the updated sentence. In order to support that, you need to be able to extend the context on demand in either direction, beyond the original "git diff" output you captured in $hunk[$i]{TEXT} (sorry, I misspelled this as $mode->{TEXT} in the previous message).
Once you start to do that, you would need to worry about the case where the hunk extended to include later lines overlaps with the hunk after the one we are currently looking at, and run coalesce_overlapping_hunks to concatenate them into a larger single hunk. But to be able to do that, you would need to keep track of the number of lines in a hunk yourself anyway, which would mean that you cannot rely on --recount anymore. The extension recently made to "git apply" becomes redundant and unused code.
In short, declaring that you are supporting the use to change ' ' to '-' means you are opening a whole can of worms, and I asked the question because I did not know if you are really prepared to deal with it.
cover git-add--interactive: use --recount, editing
In reply to Junio C HamanoQuoted 6 lines · Junio C Hamano
I recall that the original "add--interactive" carefully counted numbers in hunks it reassembles (as it can let you split and then you can choose to use both parts, which requires it to merge overlapping hunks back), but if you are going to use --recount anyway, perhaps we can discard that logic? It may make the patch application less robust, though. I dunno.
This series takes it a bit further. I played around with 'apply', and it seems there is no reason to even merge the hunks. (It would be great if someone who knows builtin-apply.c could confirm this.) So we can get rid of all recounting except for the correct splitting boundaries. These are the first two patches.
Quoted 7 lines · Junio C Hamano
Quoted 3 lines · Johannes Schindelin
I wonder why bother trying to import things when you do not need them to begin with! I mean, it is _obvious_ that in this case, we want .git/ to be writable _anyway_, so why not stick with a fixed name in that?
Good suggestion -- I love that simplicity. Thomas?
Well, changed that back.
Apart from that, no real changes to 3/3, but the $needs_recount code has become unnecessary because 1/3 already forces --recount.
- Thomas
Documentation/git-add.txt | 1 + git-add--interactive.perl | 203 ++++++++++++++++++++++--------------------- t/t3701-add-interactive.sh | 67 +++++++++++++++ 3 files changed, 172 insertions(+), 99 deletions(-)
PATCH 1/3 git-add--interactive: replace hunk recounting with apply --recount
We recounted the postimage offsets to compensate for hunks that were not selected. Now apply --recount can do the job for us.
--- git-add--interactive.perl | 30 +++--------------------------- 1 files changed, 3 insertions(+), 27 deletions(-)
git-add--interactive.perl +3 -27
@@ -970,39 +970,15 @@ sub patch_update_file { push @result, @{$mode->{TEXT}}; } for (@hunk) { - my $text = $_->{TEXT}; - my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = - parse_hunk_header($text->[0]); - - if (!$_->{USE}) { - # We would have added ($n_cnt - $o_cnt) lines - # to the postimage if we were to use this hunk, - # but we didn't. So the line number that the next - # hunk starts at would be shifted by that much. - $n_lofs -= ($n_cnt - $o_cnt); - next; - } - else { - if ($n_lofs) { - $n_ofs += $n_lofs; - $text->[0] = ("@@ -$o_ofs" . - (($o_cnt != 1) - ? ",$o_cnt" : '') . - " +$n_ofs" . - (($n_cnt != 1) - ? ",$n_cnt" : '') . - " @@\n"); - } - for (@$text) { - push @result, $_; - } + if ($_->{USE}) { + push @result, @{$_->{TEXT}}; } } if (@result) { my $fh; - open $fh, '| git apply --cached'; + open $fh, '| git apply --cached --recount'; for (@{$head->{TEXT}}, @result) { print $fh $_; }
Signature · 1 line
1.5.6.1.276.gde9a
PATCH 2/3 git-add--interactive: remove hunk coalescing
Current git-apply has no trouble at all applying chunks that have overlapping context, as produced by the splitting feature. So we can drop the manual coalescing.
--- git-add--interactive.perl | 89 --------------------------------------------- 1 files changed, 0 insertions(+), 89 deletions(-)
git-add--interactive.perl +0 -89
@@ -682,93 +682,6 @@ sub split_hunk { return @split; } -sub find_last_o_ctx { - my ($it) = @_; - my $text = $it->{TEXT}; - my ($o_ofs, $o_cnt) = parse_hunk_header($text->[0]); - my $i = @{$text}; - my $last_o_ctx = $o_ofs + $o_cnt; - while (0 < --$i) { - my $line = $text->[$i]; - if ($line =~ /^ /) { - $last_o_ctx--; - next; - } - last; - } - return $last_o_ctx; -} - -sub merge_hunk { - my ($prev, $this) = @_; - my ($o0_ofs, $o0_cnt, $n0_ofs, $n0_cnt) = - parse_hunk_header($prev->{TEXT}[0]); - my ($o1_ofs, $o1_cnt, $n1_ofs, $n1_cnt) = - parse_hunk_header($this->{TEXT}[0]); - - my (@line, $i, $ofs, $o_cnt, $n_cnt); - $ofs = $o0_ofs; - $o_cnt = $n_cnt = 0; - for ($i = 1; $i < @{$prev->{TEXT}}; $i++) { - my $line = $prev->{TEXT}[$i]; - if ($line =~ /^\+/) { - $n_cnt++; - push @line, $line; - next; - } - - last if ($o1_ofs <= $ofs); - - $o_cnt++; - $ofs++; - if ($line =~ /^ /) { - $n_cnt++; - } - push @line, $line; - } - - for ($i = 1; $i < @{$this->{TEXT}}; $i++) { - my $line = $this->{TEXT}[$i]; - if ($line =~ /^\+/) { - $n_cnt++; - push @line, $line; - next; - } - $ofs++; - $o_cnt++; - if ($line =~ /^ /) { - $n_cnt++; - } - push @line, $line; - } - my $head = ("@@ -$o0_ofs" . - (($o_cnt != 1) ? ",$o_cnt" : '') . - " +$n0_ofs" . - (($n_cnt != 1) ? ",$n_cnt" : '') . - " @@\n"); - @{$prev->{TEXT}} = ($head, @line); -} - -sub coalesce_overlapping_hunks { - my (@in) = @_; - my @out = (); - - my ($last_o_ctx); - - for (grep { $_->{USE} } @in) { - my $text = $_->{TEXT}; - my ($o_ofs) = parse_hunk_header($text->[0]); - if (defined $last_o_ctx && - $o_ofs <= $last_o_ctx) { - merge_hunk($out[-1], $_); - } - else { - push @out, $_; - } - $last_o_ctx = find_last_o_ctx($out[-1]); - } - return @out; -} sub help_patch_cmd { print colored $help_color, <<\EOF ;
@@ -962,8 +875,6 @@ sub patch_update_file { } } - @hunk = coalesce_overlapping_hunks(@hunk); - my $n_lofs = 0; my @result = (); if ($mode->{USE}) {
Signature · 1 line
1.5.6.1.276.gde9a
PATCH 3/3 git-add--interactive: manual hunk editing mode
Adds a new option 'e' to the 'add -p' command loop that lets you edit the current hunk in your favourite editor.
If the resulting patch applies cleanly, the edited hunk will immediately be marked for staging. If it does not apply cleanly, you will be given an opportunity to edit again. If all lines of the hunk are removed, then the edit is aborted and the hunk is left unchanged.
Applying the changed hunk(s) relies on Johannes Schindelin's new --recount option for git-apply.
Note that the "real patch" test intentionally uses
(echo e; echo n; echo d) | git add -p
even though the 'n' and 'd' are superfluous at first sight. They serve to get out of the interaction loop if git add -p wrongly concludes the patch does not apply.
Many thanks to Jeff King <[email protected]> for lots of help and suggestions.
--- Documentation/git-add.txt | 1 + git-add--interactive.perl | 119 ++++++++++++++++++++++++++++++++++++++++++++ t/t3701-add-interactive.sh | 67 +++++++++++++++++++++++++ 3 files changed, 187 insertions(+), 0 deletions(-)
Documentation/git-add.txt +1 -0
@@ -236,6 +236,7 @@ patch:: k - leave this hunk undecided, see previous undecided hunk K - leave this hunk undecided, see previous hunk s - split the current hunk into smaller hunks + e - manually edit the current hunk ? - print help + After deciding the fate for all hunks, if there is any hunk
git-add--interactive.perl +119 -0
149 lines not on this page · raw message
t/t3701-add-interactive.sh +67 -0
73 lines not on this page · raw message
Signature · 1 line
1.5.6.1.276.gde9a
Re: [PATCH 2/3] git-add--interactive: remove hunk coalescing
In reply to Thomas RastQuoted 42 lines · Thomas Rast
Current git-apply has no trouble at all applying chunks that have overlapping context, as produced by the splitting feature. So we can drop the manual coalescing.
Signed-off-by Thomas Rast <[email protected]>--- git-add--interactive.perl | 89 --------------------------------------------- 1 files changed, 0 insertions(+), 89 deletions(-)git-add--interactive.perl +0
-10@@ -682,93 +682,6 @@ sub split_hunk { return @split; } -sub find_last_o_ctx { -} - -sub merge_hunk { -} - -sub coalesce_overlapping_hunks { -} sub help_patch_cmd { print colored $help_color, <<\EOF ;@@ -962,8 +875,6 @@ sub patch_update_file { } } - @hunk = coalesce_overlapping_hunks(@hunk); - my $n_lofs = 0; my @result = (); if ($mode->{USE}) {Signature · 1 line
1.5.6.1.276.gde9a
I think [1/3] makes sense as we trust --recount anyway (and more importantly if the user did not muck with the patch --recount would be a no-op), but I am not sure about this one. I suspect this change reduces the precision and safety of the patch application, especially when the user does not edit hunks.
When you "[s]plit" a hunk like this:
@@ -n,7 +m,6 @@
con
text
-deleted preimage
+replaced postimage
more
line of context
-deleted another
contextinto two, we prepare these two hunks internally:
@@ -n,5 +m,5 @@
con
text
-deleted preimage
+replaced postimage
more
line of context
@@ -l,4 +k,3 @@ -- l=n+5, k=m+5
more
line of context
-deleted another
contextSo that applying only one piece without applying the other would still have correct context to locate where to apply. However, if the user says "I want to apply both after all", we would need to remove the overlap when merge them back. If you don't, you would be feeding a nonsense patch to "git apply" that goes back in context.
Blindly concatenating the above two and feeding them to "git apply" *may* happen to work by accident, not by design. This very much feels like a hack of "This works most of the time for me, your mileage may vary" kind, which we would want to avoid when we can.
Re: [PATCH 2/3] git-add--interactive: remove hunk coalescing
Quoted 4 lines · Junio C Hamano
Blindly concatenating the above two and feeding them to "git apply" *may* happen to work by accident, not by design. This very much feels like a hack of "This works most of the time for me, your mileage may vary" kind, which we would want to avoid when we can.
Well, I changed my mind. Let's run with this and see what happens.
The patch application is hunk-by-hunk in nature anyway, and if the user munges the trailing context of the first half of an originally-single hunk and the leading context of the latter half in an inconsistent way, we would notice the problem anyway.
Re: [PATCH 2/3] git-add--interactive: remove hunk coalescing
Quoted 7 lines · Junio C Hamano
Quoted 5 lines
Blindly concatenating the above two and feeding them to "git apply" *may* happen to work by accident, not by design. This very much feels like a hack of "This works most of the time for me, your mileage may vary" kind, which we would want to avoid when we can.
Well, I changed my mind. Let's run with this and see what happens.
In support of this being a feature of git-apply, notice that it even handles the situation correctly where the context of a hunk has been influenced by previous hunks, as in
@@ -1,2 +1,3 @@
foo
+quux
bar
@@ -1,3 +1,4 @@
foo
quux
+abc
bar
With Don Zickus' recent patch, it also handles patches that go over the same file twice.
- Thomas
Signature · 2 lines
Thomas Rast [email protected]
Re: [PATCH 2/3] git-add--interactive: remove hunk coalescing
Quoted 7 lines · Thomas Rast
Quoted 6 lines · Junio C Hamano
Quoted 5 lines
Blindly concatenating the above two and feeding them to "git apply" *may* happen to work by accident, not by design. This very much feels like a hack of "This works most of the time for me, your mileage may vary" kind, which we would want to avoid when we can.
Quoted 5 lines
Quoted 1 line
Well, I changed my mind. Let's run with this and see what happens.
In support of this being a feature of git-apply, notice that it even handles the situation correctly where the context of a hunk has been influenced by previous hunks, as in...
That's what meant by my earlier "application is hunk-by-hunk in nature" and we are in agreement. The fact it works that way is not quite by design and close to being "by accident", but I do not foresee anybody changing it in the near future, so...
Re: [PATCH] git-add--interactive: manual hunk editing mode
In reply to Thomas RastQuoted 7 lines · Thomas Rast
Quoted 3 lines · Jeff King
Now that this is in next, maybe it is a good time to repost the add--interactive patch (it should be independent of Dscho's 2/2 "add -e" patch).
It is independent, so I suppose you're right. (Dscho mentioned in passing he might repost "add -e" himself.)
Thanks, both.
Re: [PATCH] git-add--interactive: manual hunk editing mode
In reply to Thomas RastHi,
Quoted 1 line · Thomas Rast
(Dscho mentioned in passing he might repost "add -e" himself.)
He will not :-)
Ciao,
Dscho
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
The topics list the commits in reverse chronological order. The topics meant to be applied to the maintenance series have "maint-" in their names.
It already is beginning to become clear what 1.6.0 will look like. What's already in 'next' all are well intentioned (I do not guarantee they are already bug-free --- that is what cooking them in 'next' is for) and are good set of feature enhancements. Bigger changes will be:
* MinGW will be in.
* With the default Makefile settings, most of the programs will be installed outside your $PATH, except for "git", "gitk", "git-gui" and some server side programs that need to be accessible for technical reasons. Invoking a git subcommand as "git-xyzzy" from the command line has been deprecated since early 2006 (and officially announced in 1.5.4 release notes); use of them from your scripts after adding output from "git --exec-path" to the $PATH will still be supported in 1.6.0, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
* git-merge will be rewritten in C.
* default pack and idx versions will be updated as scheduled for some time ago.
* GIT_CONFIG, which was only documented as affecting "git config", but actually affected all git commands, now only affects "git config". GIT_LOCAL_CONFIG, also only documented as affecting "git config" and not different from GIT_CONFIG in a useful way, is removed.
----------------------------------------------------------------
[New Topics]
* js/import-zip (Mon Jun 30 19:50:44 2008 +0100) 1 commit
+ Add another fast-import example, this time for .zip files
* js/apply-root (Tue Jul 1 00:44:47 2008 +0100) 1 commit
+ Teach "git apply" to prepend a prefix with "--root=<root>"
* db/no-git-config (Mon Jun 30 03:37:47 2008 -0400) 1 commit
+ Only use GIT_CONFIG in "git config", not other programs
----------------------------------------------------------------
[Will merge to master soon]
* j6t/mingw (Sat Nov 17 20:48:14 2007 +0100) 38 commits
+ compat/pread.c: Add a forward declaration to fix a warning
+ Windows: Fix ntohl() related warnings about printf formatting
+ Windows: TMP and TEMP environment variables specify a temporary directory.
+ Windows: Make 'git help -a' work.
+ Windows: Work around an oddity when a pipe with no reader is written to.
+ Windows: Make the pager work.
+ When installing, be prepared that template_dir may be relative.
+ Windows: Use a relative default template_dir and ETC_GITCONFIG
+ Windows: Compute the fallback for exec_path from the program invocation.
+ Turn builtin_exec_path into a function.
+ Windows: Use a customized struct stat that also has the st_blocks member.
+ Windows: Add a custom implementation for utime().
+ Windows: Add a new lstat and fstat implementation based on Win32 API.
+ Windows: Implement a custom spawnve().
+ Windows: Implement wrappers for gethostbyname(), socket(), and connect().
+ Windows: Work around incompatible sort and find.
+ Windows: Implement asynchronous functions as threads.
+ Windows: Disambiguate DOS style paths from SSH URLs.
+ Windows: A rudimentary poll() emulation.
+ Windows: Implement start_command().
+ Windows: A pipe() replacement whose ends are not inherited to children.
+ Windows: Wrap execve so that shell scripts can be invoked.
+ Windows: Implement setitimer() and sigaction().
+ Windows: Fix PRIuMAX definition.
+ Windows: Implement gettimeofday().
+ Make my_mktime() public and rename it to tm_to_time_t()
+ Windows: Work around misbehaved rename().
+ Windows: always chmod(, 0666) before unlink().
+ Windows: A minimal implemention of getpwuid().
+ Windows: Implement a wrapper of the open() function.
+ Windows: Strip ".exe" from the program name.
+ Windows: Handle absolute paths in safe_create_leading_directories().
+ Windows: Treat Windows style path names.
+ setup.c: Prepare for Windows directory separators.
+ Windows: Use the Windows style PATH separator ';'.
+ Add target architecture MinGW.
+ Compile some programs only conditionally.
+ Add compat/regex.[ch] and compat/fnmatch.[ch].
No explanation necessary ;-)
----------------------------------------------------------------
[Actively Cooking]
* jc/reflog-expire (Sat Jun 28 22:24:49 2008 -0700) 2 commits
- Make default expiration period of reflog used for stash infinite
- Per-ref reflog expiry configuration
As 1.6.0 will be a good time to make backward incompatible changes, the tip commit makes the default expiry period of stash 'never', unless you configure them to expire explicitly using gc.refs/stash.* variables. Needs consensus, but I am guessing that enough people would want stash that does not expire.
We may want to change the commit topology used to represent a stash, as proposed in $gmane/85055 by Nana earlier.
* jc/merge-theirs (Mon Jun 30 22:18:57 2008 -0700) 4 commits
- Make "subtree" part more orthogonal to the rest of merge- recursive.
+ Teach git-merge to pass -X<option> to the backend strategy module
+ git-merge-recursive-{ours,theirs}
+ git-merge-file --ours, --theirs
Punting a merge by discarding your own work in conflicting parts but still salvaging the parts that are cleanly automerged. It is likely that this will result in nonsense mishmash, but somehow often people want this, so here they are. The interface to the backends is updated so that you can say "git merge -Xours -Xsubtree=foo/bar/baz -s recursive other" now.
* mv/merge-in-c (Tue Jul 1 04:37:50 2008 +0200) 14 commits
- Build in merge
- git-commit-tree: make it usable from other builtins
- Add new test case to ensure git-merge prepends the custom merge message
- Add new test case to ensure git-merge reduces octopus parents when possible
- Introduce reduce_heads()
- Introduce get_merge_bases_many()
- Add new test to ensure git-merge handles more than 25 refs.
- Introduce get_octopus_merge_bases() in commit.c
- git-fmt-merge-msg: make it usable from other builtins
- Move read_cache_unmerged() to read-cache.c
- Add new test to ensure git-merge handles pull.twohead and pull.octopus
- Move parse-options's skip_prefix() to git-compat-util.h
- Move commit_list_count() to commit.c
- Move split_cmdline() to alias.c
I think this is getting there. Will be in 'next' soon.
* dr/ceiling (Mon May 19 23:49:34 2008 -0700) 4 commits
+ Eliminate an unnecessary chdir("..")
+ Add support for GIT_CEILING_DIRECTORIES
+ Fold test-absolute-path into test-path-utils
+ Implement normalize_absolute_path
* jc/rerere (Sun Jun 22 02:04:31 2008 -0700) 5 commits
+ rerere.autoupdate
+ t4200: fix rerere test
+ rerere: remove dubious "tail_optimization"
+ git-rerere: detect unparsable conflicts
+ rerere: rerere_created_at() and has_resolution() abstraction
A new configuration will allow paths that have been resolved cleanly by rerere to be updated in the index automatically.
* ph/parseopt-step-blame (Tue Jun 24 11:12:12 2008 +0200) 7 commits
- Migrate git-blame to parse-option partially.
- parse-opt: add PARSE_OPT_KEEP_ARGV0 parser option.
- parse-opt: fake short strings for callers to believe in.
- parse-opt: do not print errors on unknown options, return -2 intead.
- parse-opt: create parse_options_step.
- parse-opt: Export a non NORETURN usage dumper.
- parse-opt: have parse_options_{start,end}.
I recall Pierre said something about cleaning up the last one when he finds time, but other than that vague recollection, I lost track of this series. I am tempted to fork a few topics off of the penúltimo one to convert a few more commands as examples and merge the result to 'next'.
----------------------------------------------------------------
[Graduated to "master"]
* ph/mergetool (Mon Jun 16 17:33:41 2008 -0600) 1 commit
+ Remove the use of '--' in merge program invocation
I got tired of waiting for success reports from people who use various backends. We will hear breakages if this breaks things anyway, and if it does, it is a fairly simple single patch to revert.
* nd/dashless (Tue Jun 24 19:58:11 2008 -0700) 2 commits
+ Keep some git-* programs in $(bindir)
+ Move all dashed-form commands to libexecdir
We'll leave server-side programs in $(bindir) so that ssh clients can ask for "git-program" and find them on the $PATH. Next major release after 1.6.0 would most likely remove the hardlinks to built-in commands, but not yet.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Prepare execv_git_cmd() for removal of builtins from the filesystem
+ git-shell: accept "git foo" form
The botched "client asks 'git foo'" is not included. It will be long after everybody runs 1.6.0.
* jk/maint-fetch-ref-hier (Fri Jun 27 00:01:41 2008 -0400) 2 commits
+ fetch: give a hint to the user when local refs fail to update
+ fetch: report local storage errors in status table
When the remote used to have "foo" branch but now has "foo/bar", fetch refuses to delete the existing remote tracking branch "foo" to create a new remote tracking branch "foo/bar", but the error message was confusing.
Need to backmerge to 'maint' after a while.
* jc/maint-reset (Wed Jun 25 18:16:36 2008 -0700) 1 commit
+ Allow "git-reset path" when unambiguous
We used to require "git-reset -- path" even when there is no ambiguity (i.e. path cannot be mistaken as a valid tree-ish and it is a filename in the work tree).
Need to backmerge to 'maint' after a while.
* js/maint-clone-insteadof (Fri Jun 27 13:55:23 2008 +0100) 2 commits
+ clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
+ clone: respect url.insteadOf setting in global configs
"git clone" did not honor "url.InsteadOf" in $HOME/.gitconfig. I think Daniel's "Let's get rid of internal use of GIT_CONFIG" makes sense (even though it feels very scary), and it would make the solution much simpler, but these two are independently good fix for now. I'll queue GIT_CONFIG one in 'next' and when it graduates the unsetenv() solution in these will become no-op.
* tr/send-email-ssl (Thu Jun 26 23:03:21 2008 +0200) 2 commits
+ git-send-email: prevent undefined variable warnings if no encryption is set
+ git-send-email: add support for TLS via Net::SMTP::SSL
* kb/send-email-fifo (Wed Jun 25 15:44:40 2008 -0700) 1 commit
+ git-send-email: Accept fifos as well as files
Two minor send-email feature enhancements.
* jc/checkdiff (Sun Jun 29 16:49:06 2008 -0400) 7 commits
+ Fix t4017-diff-retval for white-space from wc
+ Update sample pre-commit hook to use "diff --check"
+ diff --check: detect leftover conflict markers
+ Teach "diff --check" about new blank lines at end
+ checkdiff: pass diff_options to the callback
+ check_and_emit_line(): rename and refactor
+ diff --check: explain why we do not care whether old side is binary
Allows us to replace the sample pre-commit hook that was not aware of the line termination convention per path nor newer whitespace breakage rules.
* np/pack-default (Wed Jun 25 00:25:53 2008 -0400) 2 commits
+ pack.indexversion config option now defaults to 2
+ repack.usedeltabaseoffset config option now defaults to "true"
Updates the default value for pack.indexversion to 2 and use delta-base offset encoding of the packfiles by default.
* js/apply-recount (Fri Jun 27 18:43:09 2008 +0100) 1 commit
+ Allow git-apply to recount the lines in a hunk (AKA recountdiff)
A good ingredient for implementing "apply --edit".
* dz/apply-again (Fri Jun 27 14:39:12 2008 -0400) 1 commit
+ git-apply: handle a patch that touches the same path more than once better
Allows us to feed a patch that touches the same path more than once.
----------------------------------------------------------------
[On Hold]
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config variables
This was previously in "will be in master soon" category, but it turns out that the synonyms to the ones this one deletes are fairly new invention that happend in 1.5.6 timeframe, and we cannot do this just yet.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0 timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly asked for
This would be the right thing to do for command line use, but gitk will be hit due to tcl/tk's limitation, so I am holding this back for now.
----------------------------------------------------------------
[Stalled/Needs more work]
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 7 commits
- blame: show "previous" information in --porcelain/--incremental format
- git-blame: refactor code to emit "porcelain format" output
+ git-blame --reverse
+ builtin-blame.c: allow more than 16 parents
+ builtin-blame.c: move prepare_final() into a separate function.
+ rev-list --children
+ revision traversal: --children option
The blame that finds where each line in the original lines moved to. This may help a GSoC project that wants to gather statistical overview of the history. The final presentation may need tweaking (see the log message of the commit ""git-blame --reverse" on the series).
The tip two commits are for peeling to see what's behind the blamed commit, which we should be able to separate out into an independent topic from the rest.
----------------------------------------------------------------
[Dropped for now]
* sj/merge (Sat May 3 16:55:47 2008 -0700) 6 commits . Introduce fast forward option only
. Head reduction before selecting merge strategy . Restructure git-merge.sh
. Introduce -ff=<fast forward option>
. New merge tests
. Documentation for joining more than two histories
This will interfere with Miklos's rewrite of merge to C.
* js/rebase-i-sequencer (Sun Apr 27 02:55:50 2008 -0400) 17 commits . Use perl instead of tac
. Fix t3404 assumption that wc -l does not use whitespace. . rebase -i: Use : in expr command instead of match.
. rebase -i: update the implementation of 'mark' command . Add option --preserve-tags
. Teach rebase interactive the tag command
. Add option --first-parent
. Do rebase with preserve merges with advanced TODO list . Select all lines with fake-editor
. Unify the length of $SHORT* and the commits in the TODO list . Teach rebase interactive the merge command
. Move redo merge code in a function
. Teach rebase interactive the reset command
. Teach rebase interactive the mark command
. Move cleanup code into it's own function
. Don't append default merge message to -m message
. fake-editor: output TODO list if unchanged
* jc/cherry-pick (Wed Feb 20 23:17:06 2008 -0800) 3 commits . WIP: rethink replay merge
. Start using replay-tree merge in cherry-pick
. revert/cherry-pick: start refactoring call to merge_recursive
This is meant to improve cherry-pick's behaviour when renames are involved, by not using merge-recursive (whose d/f conflict resolution is quite broken), but unfortunately has stalled for some time now.
* jc/stripspace (Sun Mar 9 00:30:35 2008 -0800) 6 commits . git-am --forge: add Signed-off-by: line for the author . git-am: clean-up Signed-off-by: lines
. stripspace: add --log-clean option to clean up signed-off-by:
lines
. stripspace: use parse_options()
. Add "git am -s" test
. git-am: refactor code to add signed-off-by line for the committer
Just my toy at this moment.
* jc/send-pack-tell-me-more (Thu Mar 20 00:44:11 2008 -0700) 1 commit . "git push": tellme-more protocol extension
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
The topics list the commits in reverse chronological order. The topics meant to be applied to the maintenance series have "maint-" in their names.
It already is beginning to become clear what 1.6.0 will look like. What's already in 'next' all are well intentioned (I do not guarantee they are already bug-free --- that is what cooking them in 'next' is for) and are good set of feature enhancements. Bigger changes will be:
* Port for MinGW.
* With the default Makefile settings, most of the programs will be installed outside your $PATH, except for "git", "gitk", "git-gui" and some server side programs that need to be accessible for technical reasons. Invoking a git subcommand as "git-xyzzy" from the command line has been deprecated since early 2006 (and officially announced in 1.5.4 release notes); use of them from your scripts after adding output from "git --exec-path" to the $PATH will still be supported in 1.6.0, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
* git-merge will be rewritten in C.
* default pack and idx versions will be updated as scheduled for some time ago.
* GIT_CONFIG, which was only documented as affecting "git config", but actually affected all git commands, now only affects "git config". GIT_LOCAL_CONFIG, also only documented as affecting "git config" and not different from GIT_CONFIG in a useful way, is removed.
----------------------------------------------------------------
[New Topics]
* js/maint-daemon-syslog (Thu Jul 3 16:27:24 2008 +0100) 1 commit
- [PARKED improvement suggested not rolled in] git daemon: avoid calling syslog() from a signal handler
This will eventually appear in 'maint'; currently parked on 'pu', though.
* jc/report-tracking (Sun Jul 6 02:54:56 2008 -0700) 5 commits
- branch -r -v: do not spit out garbage
+ stat_tracking_info(): clear object flags used during counting
+ git-branch -v: show the remote tracking statistics
+ git-status: show the remote tracking statistics
+ Refactor "tracking statistics" code used by "git checkout"
Makes the "your branch is ahead of the tracked one by N commits" logic and messages available to other commands; status and branch are updated.
* sg/stash-k-i (Fri Jun 27 16:37:15 2008 +0200) 1 commit
- stash: introduce 'stash save --keep-index' option
One weakness of our "partial commit" workflow support used to be that the user can incrementally build what is to be committed in the index but that state cannot be tested as a whole in the working tree. This allows you to temporarily stash the remaining changes in the working tree so that the index state before running "stash save --keep-index" can be seen in the working tree to be tested and then committed. A recommended workflow to use after that commit is made needs to be documented (and support needs to be added if necessary).
* tr/add-i-e (Thu Jul 3 00:00:00 2008 +0200) 3 commits
+ git-add--interactive: manual hunk editing mode
+ git-add--interactive: remove hunk coalescing
+ git-add--interactive: replace hunk recounting with apply --recount
Adds 'e/dit' action to interactive add command.
* am/stash-branch (Thu Jul 3 11:46:05 2008 +0530) 1 commit
+ Implement "git stash branch <newbranch> <stash>"
Creates a new branch out of the stashed state, after returning from the interrupt that forced you to create the stash in the first place.
* jc/grafts (Wed Jul 2 17:14:12 2008 -0700) 1 commit
- Ignore graft during object transfer [broken wrt shallow clones]
Cloning or fetching from a repository from grafts did not send objects that are hidden by grafts, but the commits in the resulting repository do need these to pass fsck. This fixes object transfer to ignore grafts.
Another fix is needed to git-prune so that it ignores grafts but treats commits that are mentioned in grafts as reachable.
* jk/pager-config (Thu Jul 3 07:46:57 2008 -0400) 1 commit
- Allow per-command pager config
----------------------------------------------------------------
[Will merge to master soon]
* js/import-zip (Mon Jun 30 19:50:44 2008 +0100) 1 commit
+ Add another fast-import example, this time for .zip files
* js/apply-root (Wed Jul 2 15:28:22 2008 -0700) 2 commits
+ apply --root: thinkofix.
+ Teach "git apply" to prepend a prefix with "--root=<root>"
* db/no-git-config (Mon Jun 30 03:37:47 2008 -0400) 1 commit
+ Only use GIT_CONFIG in "git config", not other programs
* jc/reflog-expire (Sat Jun 28 22:24:49 2008 -0700) 2 commits
+ Make default expiration period of reflog used for stash infinite
+ Per-ref reflog expiry configuration
As 1.6.0 will be a good time to make backward incompatible changes, the tip commit makes the default expiry period of stash 'never', unless you configure them to expire explicitly using gc.refs/stash.* variables. Needs consensus, but I am guessing that enough people would want stash that does not expire.
* dr/ceiling (Mon May 19 23:49:34 2008 -0700) 4 commits
+ Eliminate an unnecessary chdir("..")
+ Add support for GIT_CEILING_DIRECTORIES
+ Fold test-absolute-path into test-path-utils
+ Implement normalize_absolute_path
This still feels "because we can", not "because we need to", but it came from somebody who had the need to, and I do not think it hurts people without the environment variable set.
* jc/rerere (Sun Jun 22 02:04:31 2008 -0700) 5 commits
+ rerere.autoupdate
+ t4200: fix rerere test
+ rerere: remove dubious "tail_optimization"
+ git-rerere: detect unparsable conflicts
+ rerere: rerere_created_at() and has_resolution() abstraction
A new configuration will allow paths that have been resolved cleanly by rerere to be updated in the index automatically.
To me, this is "because we can", but was something requested by Ingo, so presumably some people may feel it useful in their workflow.
----------------------------------------------------------------
[Actively Cooking]
* mv/merge-in-c (Tue Jul 1 04:37:50 2008 +0200) 15 commits
- [REJECT -- over-abuse of path-list] Build in merge
+ Fix t7601-merge-pull-config.sh on AIX
+ git-commit-tree: make it usable from other builtins
+ Add new test case to ensure git-merge prepends the custom merge message
+ Add new test case to ensure git-merge reduces octopus parents when possible
+ Introduce reduce_heads()
+ Introduce get_merge_bases_many()
+ Add new test to ensure git-merge handles more than 25 refs.
+ Introduce get_octopus_merge_bases() in commit.c
+ git-fmt-merge-msg: make it usable from other builtins
+ Move read_cache_unmerged() to read-cache.c
+ Add new test to ensure git-merge handles pull.twohead and pull.octopus
+ Move parse-options's skip_prefix() to git-compat-util.h
+ Move commit_list_count() to commit.c
+ Move split_cmdline() to alias.c
The last one is still not quite there, I am afraid.
----------------------------------------------------------------
[Graduated to "master"]
* j6t/mingw (Sat Nov 17 20:48:14 2007 +0100) 38 commits
+ compat/pread.c: Add a forward declaration to fix a warning
+ Windows: Fix ntohl() related warnings about printf formatting
+ Windows: TMP and TEMP environment variables specify a temporary directory.
+ Windows: Make 'git help -a' work.
+ Windows: Work around an oddity when a pipe with no reader is written to.
+ Windows: Make the pager work.
+ When installing, be prepared that template_dir may be relative.
+ Windows: Use a relative default template_dir and ETC_GITCONFIG
+ Windows: Compute the fallback for exec_path from the program invocation.
+ Turn builtin_exec_path into a function.
+ Windows: Use a customized struct stat that also has the st_blocks member.
+ Windows: Add a custom implementation for utime().
+ Windows: Add a new lstat and fstat implementation based on Win32 API.
+ Windows: Implement a custom spawnve().
+ Windows: Implement wrappers for gethostbyname(), socket(), and connect().
+ Windows: Work around incompatible sort and find.
+ Windows: Implement asynchronous functions as threads.
+ Windows: Disambiguate DOS style paths from SSH URLs.
+ Windows: A rudimentary poll() emulation.
+ Windows: Implement start_command().
+ Windows: A pipe() replacement whose ends are not inherited to children.
+ Windows: Wrap execve so that shell scripts can be invoked.
+ Windows: Implement setitimer() and sigaction().
+ Windows: Fix PRIuMAX definition.
+ Windows: Implement gettimeofday().
+ Make my_mktime() public and rename it to tm_to_time_t()
+ Windows: Work around misbehaved rename().
+ Windows: always chmod(, 0666) before unlink().
+ Windows: A minimal implemention of getpwuid().
+ Windows: Implement a wrapper of the open() function.
+ Windows: Strip ".exe" from the program name.
+ Windows: Handle absolute paths in safe_create_leading_directories().
+ Windows: Treat Windows style path names.
+ setup.c: Prepare for Windows directory separators.
+ Windows: Use the Windows style PATH separator ';'.
+ Add target architecture MinGW.
+ Compile some programs only conditionally.
+ Add compat/regex.[ch] and compat/fnmatch.[ch].
----------------------------------------------------------------
[On Hold]
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config variables
This was previously in "will be in master soon" category, but it turns out that the synonyms to the ones this one deletes are fairly new invention that happend in 1.5.6 timeframe, and we cannot do this just yet. Perhaps in 1.7.0.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0 timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly asked for
This would be the right thing to do for command line use, but gitk will be hit due to tcl/tk's limitation, so I am holding this back for now.
----------------------------------------------------------------
[Stalled/Needs more work]
* ph/parseopt-step-blame (Tue Jun 24 11:12:12 2008 +0200) 7 commits
- Migrate git-blame to parse-option partially.
+ parse-opt: add PARSE_OPT_KEEP_ARGV0 parser option.
+ parse-opt: fake short strings for callers to believe in.
+ parse-opt: do not print errors on unknown options, return -2 intead.
+ parse-opt: create parse_options_step.
+ parse-opt: Export a non NORETURN usage dumper.
+ parse-opt: have parse_options_{start,end}.
I recall Pierre said something about cleaning up the last one when he finds time, but other than that vague recollection, I lost track of this series. I am tempted to fork a few topics off of the penúltimo one to convert a few more commands as examples and merge the result to 'next'.
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 7 commits
- blame: show "previous" information in --porcelain/--incremental format
- git-blame: refactor code to emit "porcelain format" output
+ git-blame --reverse
+ builtin-blame.c: allow more than 16 parents
+ builtin-blame.c: move prepare_final() into a separate function.
+ rev-list --children
+ revision traversal: --children option
The blame that finds where each line in the original lines moved to. This may help a GSoC project that wants to gather statistical overview of the history. The final presentation may need tweaking (see the log message of the commit ""git-blame --reverse" on the series).
The tip two commits are for peeling to see what's behind the blamed commit, which we should be able to separate out into an independent topic from the rest.
* jc/merge-theirs (Mon Jun 30 22:18:57 2008 -0700) 5 commits
+ Make "subtree" part more orthogonal to the rest of merge- recursive.
+ Teach git-pull to pass -X<option> to git-merge
+ Teach git-merge to pass -X<option> to the backend strategy module
+ git-merge-recursive-{ours,theirs}
+ git-merge-file --ours, --theirs
Punting a merge by discarding your own work in conflicting parts but still salvaging the parts that are cleanly automerged. It is likely that this will result in nonsense mishmash, but somehow often people want this, so here they are. The interface to the backends is updated so that you can say "git merge -Xours -Xsubtree=foo/bar/baz -s recursive other" now.
The -X<option> part may change, Dscho mentions that a single-letter -X that take stuck option is against syntax rules, and I think he's right.
This is more "because we can", not "because we need to".
Hi,
Quoted 3 lines · Junio C Hamano
* js/apply-root (Wed Jul 2 15:28:22 2008 -0700) 2 commits
+ apply --root: thinkofix.
+ Teach "git apply" to prepend a prefix with "--root=<root>"
If we want to call this "--directory=<root>" instead, we should do it before that commit hits master.
Ciao,
Dscho
Quoted 8 lines · Johannes Schindelin
Quoted 3 lines · Junio C Hamano
* js/apply-root (Wed Jul 2 15:28:22 2008 -0700) 2 commits
+ apply --root: thinkofix.
+ Teach "git apply" to prepend a prefix with "--root=<root>"If we want to call this "--directory=<root>" instead, we should do it before that commit hits master.
Yeah, perhaps like this?
-- >8 --
git-apply --directory: make --root more similar to GNU diff
Applying a patch in the directory that is different from what the patch records is done with --directory option in GNU diff. The --root option we introduced previously does the same, and we can call it the same way to give users more familiar feel.
--- Documentation/git-apply.txt | 8 ++++++-- builtin-apply.c | 4 ++-- t/t4128-apply-root.sh | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-)
Documentation/git-apply.txt +6 -2
@@ -14,7 +14,7 @@ SYNOPSIS [--allow-binary-replacement | --binary] [--reject] [-z] [-pNUM] [-CNUM] [--inaccurate-eof] [--cached] [--whitespace=<nowarn|warn|fix|error|error-all>] - [--exclude=PATH] [--root=<root>] [--verbose] [<patch>...] + [--exclude=PATH] [--directory=<root>] [--verbose] [<patch>...] DESCRIPTION -----------
@@ -177,9 +177,13 @@ behavior: current patch being applied will be printed. This option will cause additional information to be reported. ---root=<root>:: +--directory=<root>:: Prepend <root> to all filenames. If a "-p" argument was passed, too, it is applied before prepending the new root. ++ +For example, a patch that talks about updating `a/git-gui.sh` to `b/git-gui.sh` +can be applied to the file in the working tree `modules/git-gui/git-gui.sh` by +running `git apply --directory=modules/git-gui`. Configuration -------------
builtin-apply.c +2 -2
@@ -3130,8 +3130,8 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix) inaccurate_eof =1 ;continue ; } -if (!prefixcmp (arg,"--root=" )) { - arg +=strlen ("--root=" ); +if (!prefixcmp (arg,"--directory=" )) { + arg +=strlen ("--directory=" ); root_len =strlen (arg);if (root_len && arg[root_len -1 ] !='/' ) {char *new_root;
t/t4128-apply-root.sh +4 -4
@@ -23,18 +23,18 @@ diff a/bla/blub/dir/file b/bla/blub/dir/file +Bello EOF -test_expect_success 'apply --root -p (1)' ' +test_expect_success 'apply --directory -p (1)' ' - git apply --root=some/sub -p3 --index patch && + git apply --directory=some/sub -p3 --index patch && test Bello = $(git show :some/sub/dir/file) && test Bello = $(cat some/sub/dir/file) ' -test_expect_success 'apply --root -p (2) ' ' +test_expect_success 'apply --directory -p (2) ' ' git reset --hard initial && - git apply --root=some/sub/ -p3 --index patch && + git apply --directory=some/sub/ -p3 --index patch && test Bello = $(git show :some/sub/dir/file) && test Bello = $(cat some/sub/dir/file)
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
The topics list the commits in reverse chronological order. The topics meant to be applied to the maintenance series have "maint-" in their names.
It already is beginning to become clear what 1.6.0 will look like. What's already in 'next' all are well intentioned (I do not guarantee they are already bug-free --- that is what cooking them in 'next' is for) and are good set of feature enhancements. Bigger changes will be:
* Port for MinGW.
* With the default Makefile settings, most of the programs will be installed outside your $PATH, except for "git", "gitk", "git-gui" and some server side programs that need to be accessible for technical reasons. Invoking a git subcommand as "git-xyzzy" from the command line has been deprecated since early 2006 (and officially announced in 1.5.4 release notes); use of them from your scripts after adding output from "git --exec-path" to the $PATH will still be supported in 1.6.0, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
* git-merge will be rewritten in C.
* default pack and idx versions will be updated as scheduled for some time ago.
* GIT_CONFIG, which was only documented as affecting "git config", but actually affected all git commands, now only affects "git config". GIT_LOCAL_CONFIG, also only documented as affecting "git config" and not different from GIT_CONFIG in a useful way, is removed.
----------------------------------------------------------------
[New Topics]
* jc/rebase-orig-head (Mon Jul 7 00:16:38 2008 -0700) 1 commit
+ Teach "am" and "rebase" to mark the original position with ORIG_HEAD
* sb/sequencer (Tue Jul 1 04:38:34 2008 +0200) 4 commits . Migrate git-am to use git-sequencer
. Add git-sequencer test suite (t3350)
. Add git-sequencer prototype documentation
. Add git-sequencer shell prototype
* js/pick-root (Fri Jul 4 16:19:52 2008 +0100) 1 commit
+ Allow cherry-picking root commits
* ab/bundle (Sat Jul 5 17:26:40 2008 -0400) 1 commit
+ Teach git-bundle to read revision arguments from stdin like git- rev-list.
----------------------------------------------------------------
[Will merge to master soon]
* js/apply-root (Sun Jul 6 18:36:01 2008 -0700) 3 commits
+ git-apply --directory: make --root more similar to GNU diff
+ apply --root: thinkofix.
+ Teach "git apply" to prepend a prefix with "--root=<root>"
* jc/reflog-expire (Sat Jun 28 22:24:49 2008 -0700) 2 commits
+ Make default expiration period of reflog used for stash infinite
+ Per-ref reflog expiry configuration
As 1.6.0 will be a good time to make backward incompatible changes, the tip commit makes the default expiry period of stash 'never', unless you configure them to expire explicitly using gc.refs/stash.* variables. Needs consensus, but I am guessing that enough people would want stash that does not expire.
* jk/pager-config (Thu Jul 3 07:46:57 2008 -0400) 1 commit
+ Allow per-command pager config
----------------------------------------------------------------
[Actively Cooking]
* sg/stash-k-i (Fri Jun 27 16:37:15 2008 +0200) 1 commit
+ stash: introduce 'stash save --keep-index' option
One weakness of our "partial commit" workflow support used to be that the user can incrementally build what is to be committed in the index but that state cannot be tested as a whole in the working tree. This allows you to temporarily stash the remaining changes in the working tree so that the index state before running "stash save --keep-index" can be seen in the working tree to be tested and then committed.
* am/stash-branch (Mon Jul 7 02:50:10 2008 +0530) 2 commits
+ Add a test for "git stash branch"
+ Implement "git stash branch <newbranch> <stash>"
Creates a new branch out of the stashed state, after returning from the interrupt that forced you to create the stash in the first place.
* tr/add-i-e (Thu Jul 3 00:00:00 2008 +0200) 3 commits
+ git-add--interactive: manual hunk editing mode
+ git-add--interactive: remove hunk coalescing
+ git-add--interactive: replace hunk recounting with apply --recount
Adds 'e/dit' action to interactive add command.
* jc/report-tracking (Sun Jul 6 02:54:56 2008 -0700) 5 commits
+ branch -r -v: do not spit out garbage
+ stat_tracking_info(): clear object flags used during counting
+ git-branch -v: show the remote tracking statistics
+ git-status: show the remote tracking statistics
+ Refactor "tracking statistics" code used by "git checkout"
Makes the "your branch is ahead of the tracked one by N commits" logic and messages available to other commands; status and branch are updated.
* jc/merge-theirs (Mon Jun 30 22:18:57 2008 -0700) 5 commits
+ Make "subtree" part more orthogonal to the rest of merge- recursive.
+ Teach git-pull to pass -X<option> to git-merge
+ Teach git-merge to pass -X<option> to the backend strategy module
+ git-merge-recursive-{ours,theirs}
+ git-merge-file --ours, --theirs
Punting a merge by discarding your own work in conflicting parts but still salvaging the parts that are cleanly automerged. It is likely that this will result in nonsense mishmash, but somehow often people want this, so here they are. The interface to the backends is updated so that you can say "git merge -Xours -Xsubtree=foo/bar/baz -s recursive other" now.
The -X<option> part may change, Dscho mentions that a single-letter -X that take stuck option is against syntax rules, and I think he's right.
This is more "because we can", not "because we need to".
* mv/merge-in-c (Mon Jul 7 19:24:20 2008 +0200) 15 commits
- Build in merge
+ Fix t7601-merge-pull-config.sh on AIX
+ git-commit-tree: make it usable from other builtins
+ Add new test case to ensure git-merge prepends the custom merge message
+ Add new test case to ensure git-merge reduces octopus parents when possible
+ Introduce reduce_heads()
+ Introduce get_merge_bases_many()
+ Add new test to ensure git-merge handles more than 25 refs.
+ Introduce get_octopus_merge_bases() in commit.c
+ git-fmt-merge-msg: make it usable from other builtins
+ Move read_cache_unmerged() to read-cache.c
+ Add new test to ensure git-merge handles pull.twohead and pull.octopus
+ Move parse-options's skip_prefix() to git-compat-util.h
+ Move commit_list_count() to commit.c
+ Move split_cmdline() to alias.c
----------------------------------------------------------------
[Graduated to "master"]
* js/import-zip (Mon Jun 30 19:50:44 2008 +0100) 1 commit
+ Add another fast-import example, this time for .zip files
* db/no-git-config (Mon Jun 30 03:37:47 2008 -0400) 1 commit
+ Only use GIT_CONFIG in "git config", not other programs
* dr/ceiling (Mon May 19 23:49:34 2008 -0700) 4 commits
+ Eliminate an unnecessary chdir("..")
+ Add support for GIT_CEILING_DIRECTORIES
+ Fold test-absolute-path into test-path-utils
+ Implement normalize_absolute_path
* jc/rerere (Sun Jun 22 02:04:31 2008 -0700) 5 commits
+ rerere.autoupdate
+ t4200: fix rerere test
+ rerere: remove dubious "tail_optimization"
+ git-rerere: detect unparsable conflicts
+ rerere: rerere_created_at() and has_resolution() abstraction
A new configuration will allow paths that have been resolved cleanly by rerere to be updated in the index automatically.
* js/maint-daemon-syslog (Thu Jul 3 16:27:24 2008 +0100) 1 commit
+ git daemon: avoid calling syslog() from a signal handler
Meant for 'maint' as well.
----------------------------------------------------------------
[On Hold]
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config variables
This was previously in "will be in master soon" category, but it turns out that the synonyms to the ones this one deletes are fairly new invention that happend in 1.5.6 timeframe, and we cannot do this just yet. Perhaps in 1.7.0.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0 timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly asked for
This would be the right thing to do for command line use, but gitk will be hit due to tcl/tk's limitation, so I am holding this back for now.
----------------------------------------------------------------
[Stalled/Needs more work]
* jc/grafts (Wed Jul 2 17:14:12 2008 -0700) 1 commit
- [BROKEN wrt shallow clones] Ignore graft during object transfer
Cloning or fetching from a repository from grafts did not send objects that are hidden by grafts, but the commits in the resulting repository do need these to pass fsck. This fixes object transfer to ignore grafts.
Another fix is needed to git-prune so that it ignores grafts but treats commits that are mentioned in grafts as reachable.
* ph/parseopt-step-blame (Tue Jun 24 11:12:12 2008 +0200) 7 commits
- Migrate git-blame to parse-option partially.
+ parse-opt: add PARSE_OPT_KEEP_ARGV0 parser option.
+ parse-opt: fake short strings for callers to believe in.
+ parse-opt: do not print errors on unknown options, return -2 intead.
+ parse-opt: create parse_options_step.
+ parse-opt: Export a non NORETURN usage dumper.
+ parse-opt: have parse_options_{start,end}.
I recall Pierre said something about cleaning up the last one when he finds time, but other than that vague recollection, I lost track of this series. I am tempted to fork a few topics off of the penúltimo one to convert a few more commands as examples and merge the result to 'next'.
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 7 commits
- blame: show "previous" information in --porcelain/--incremental format
- git-blame: refactor code to emit "porcelain format" output
+ git-blame --reverse
+ builtin-blame.c: allow more than 16 parents
+ builtin-blame.c: move prepare_final() into a separate function.
+ rev-list --children
+ revision traversal: --children option
The blame that finds where each line in the original lines moved to. This may help a GSoC project that wants to gather statistical overview of the history. The final presentation may need tweaking (see the log message of the commit ""git-blame --reverse" on the series).
The tip two commits are for peeling to see what's behind the blamed commit, which we should be able to separate out into an independent topic from the rest.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
The topics list the commits in reverse chronological order. The topics meant to be applied to the maintenance series have "maint-" in their names.
It already is beginning to become clear what 1.6.0 will look like. What's already in 'next' all are well intentioned (I do not guarantee they are already bug-free --- that is what cooking them in 'next' is for) and are good set of feature enhancements. Bigger changes will be:
* Port for MinGW.
* With the default Makefile settings, most of the programs will be installed outside your $PATH, except for "git", "gitk", "git-gui" and some server side programs that need to be accessible for technical reasons. Invoking a git subcommand as "git-xyzzy" from the command line has been deprecated since early 2006 (and officially announced in 1.5.4 release notes); use of them from your scripts after adding output from "git --exec-path" to the $PATH will still be supported in 1.6.0, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
* git-merge will be rewritten in C.
* default pack and idx versions will be updated as scheduled for some time ago.
* GIT_CONFIG, which was only documented as affecting "git config", but actually affected all git commands, now only affects "git config". GIT_LOCAL_CONFIG, also only documented as affecting "git config" and not different from GIT_CONFIG in a useful way, is removed.
----------------------------------------------------------------
[New Topics]
* xx/merge-in-c-into-next (Wed Jul 9 13:51:46 2008 -0700) 4 commits
+ Teach git-merge -X<option> again.
+ Merge branch 'jc/merge-theirs' into xx/merge-in-c-into-next
+ builtin-merge.c: use parse_options_step() "incremental parsing" machinery
+ Merge branch 'ph/parseopt-step-blame' into xx/merge-in-c-into-next
I've described what this is in a separate message.
* jc/branch-merged (Tue Jul 8 17:55:47 2008 -0700) 3 commits
+ branch --merged/--no-merged: allow specifying arbitrary commit
+ branch --contains: default to HEAD
+ parse-options: add PARSE_OPT_LASTARG_DEFAULT flag
This builds on top of the parse-options enhancement series that has been cooking in 'next' for some time.
* rs/imap (Wed Jul 9 22:29:02 2008 +0100) 5 commits
+ Documentation: Improve documentation for git-imap-send(1)
+ imap-send.c: more style fixes
+ imap-send.c: style fixes
+ git-imap-send: Support SSL
+ git-imap-send: Allow the program to be run from subdirectories of a git tree
* om/rerere-careful (Mon Jul 7 14:42:48 2008 +0200) 1 commit
+ builtin-rerere: more carefully find conflict markers
----------------------------------------------------------------
[Will merge to master soon]
* js/pick-root (Fri Jul 4 16:19:52 2008 +0100) 1 commit
+ Allow cherry-picking root commits
* ab/bundle (Sat Jul 5 17:26:40 2008 -0400) 1 commit
+ Teach git-bundle to read revision arguments from stdin like git- rev-list.
* sg/stash-k-i (Tue Jul 8 00:40:56 2008 -0700) 2 commits
+ Documentation: tweak use case in "git stash save --keep-index"
+ stash: introduce 'stash save --keep-index' option
One weakness of our "partial commit" workflow support used to be that the user can incrementally build what is to be committed in the index but that state cannot be tested as a whole in the working tree. This allows you to temporarily stash the remaining changes in the working tree so that the index state before running "stash save --keep-index" can be seen in the working tree to be tested and then committed.
* am/stash-branch (Mon Jul 7 02:50:10 2008 +0530) 2 commits
+ Add a test for "git stash branch"
+ Implement "git stash branch <newbranch> <stash>"
Creates a new branch out of the stashed state, after returning from the interrupt that forced you to create the stash in the first place.
* tr/add-i-e (Thu Jul 3 00:00:00 2008 +0200) 3 commits
+ git-add--interactive: manual hunk editing mode
+ git-add--interactive: remove hunk coalescing
+ git-add--interactive: replace hunk recounting with apply --recount
Adds 'e/dit' action to interactive add command.
* jc/report-tracking (Sun Jul 6 02:54:56 2008 -0700) 5 commits
+ branch -r -v: do not spit out garbage
+ stat_tracking_info(): clear object flags used during counting
+ git-branch -v: show the remote tracking statistics
+ git-status: show the remote tracking statistics
+ Refactor "tracking statistics" code used by "git checkout"
Makes the "your branch is ahead of the tracked one by N commits" logic and messages available to other commands; status and branch are updated.
----------------------------------------------------------------
[Actively Cooking]
* jc/rebase-orig-head (Tue Jul 8 00:12:22 2008 -0400) 2 commits
+ Documentation: mention ORIG_HEAD in am, merge, and rebase
+ Teach "am" and "rebase" to mark the original position with ORIG_HEAD
* ph/parseopt-step-blame (Wed Jul 9 23:38:34 2008 +0200) 18 commits
+ revisions: refactor handle_revision_opt into parse_revision_opt.
+ git-shortlog: migrate to parse-options partially.
+ git-blame: fix lapsus
+ git-blame: migrate to incremental parse-option [2/2]
+ git-blame: migrate to incremental parse-option [1/2]
+ revisions: split handle_revision_opt() from setup_revisions()
+ Merge branch 'jc/blame' (early part) into HEAD
+ parse-opt: add PARSE_OPT_KEEP_ARGV0 parser option.
+ parse-opt: fake short strings for callers to believe in.
+ parse-opt: do not print errors on unknown options, return -2 intead.
+ parse-opt: create parse_options_step.
+ parse-opt: Export a non NORETURN usage dumper.
+ parse-opt: have parse_options_{start,end}.
+ git-blame --reverse
+ builtin-blame.c: allow more than 16 parents
+ builtin-blame.c: move prepare_final() into a separate function.
+ rev-list --children
+ revision traversal: --children option
Became active again ;-) This probably is ready for 'master' already, except for the last two which I only looked at the patch and have not used heavily in production yet.
* jc/merge-theirs (Mon Jun 30 22:18:57 2008 -0700) 5 commits
+ Make "subtree" part more orthogonal to the rest of merge- recursive.
+ Teach git-pull to pass -X<option> to git-merge
+ Teach git-merge to pass -X<option> to the backend strategy module
+ git-merge-recursive-{ours,theirs}
+ git-merge-file --ours, --theirs
Punting a merge by discarding your own work in conflicting parts but still salvaging the parts that are cleanly automerged. It is likely that this will result in nonsense mishmash, but somehow often people want this, so here they are. The interface to the backends is updated so that you can say "git merge -Xours -Xsubtree=foo/bar/baz -s recursive other" now.
* mv/merge-in-c (Mon Jul 7 19:24:20 2008 +0200) 15 commits
+ Build in merge
+ Fix t7601-merge-pull-config.sh on AIX
+ git-commit-tree: make it usable from other builtins
+ Add new test case to ensure git-merge prepends the custom merge message
+ Add new test case to ensure git-merge reduces octopus parents when possible
+ Introduce reduce_heads()
+ Introduce get_merge_bases_many()
+ Add new test to ensure git-merge handles more than 25 refs.
+ Introduce get_octopus_merge_bases() in commit.c
+ git-fmt-merge-msg: make it usable from other builtins
+ Move read_cache_unmerged() to read-cache.c
+ Add new test to ensure git-merge handles pull.twohead and pull.octopus
+ Move parse-options's skip_prefix() to git-compat-util.h
+ Move commit_list_count() to commit.c
+ Move split_cmdline() to alias.c
----------------------------------------------------------------
[Graduated to "master"]
* js/apply-root (Sun Jul 6 18:36:01 2008 -0700) 3 commits
+ git-apply --directory: make --root more similar to GNU diff
+ apply --root: thinkofix.
+ Teach "git apply" to prepend a prefix with "--root=<root>"
* jc/reflog-expire (Sat Jun 28 22:24:49 2008 -0700) 2 commits
+ Make default expiration period of reflog used for stash infinite
+ Per-ref reflog expiry configuration
As 1.6.0 will be a good time to make backward incompatible changes, the tip commit makes the default expiry period of stash 'never', unless you configure them to expire explicitly using gc.refs/stash.* variables. Needs consensus, but I am guessing that enough people would want stash that does not expire.
* jk/pager-config (Thu Jul 3 07:46:57 2008 -0400) 1 commit
+ Allow per-command pager config
----------------------------------------------------------------
[On Hold]
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config variables
This was previously in "will be in master soon" category, but it turns out that the synonyms to the ones this one deletes are fairly new invention that happend in 1.5.6 timeframe, and we cannot do this just yet. Perhaps in 1.7.0.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0 timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly asked for
This would be the right thing to do for command line use, but gitk will be hit due to tcl/tk's limitation, so I am holding this back for now.
----------------------------------------------------------------
[Stalled/Needs more work]
* sb/sequencer (Tue Jul 1 04:38:34 2008 +0200) 4 commits . Migrate git-am to use git-sequencer
. Add git-sequencer test suite (t3350)
. Add git-sequencer prototype documentation
. Add git-sequencer shell prototype
* jc/grafts (Wed Jul 2 17:14:12 2008 -0700) 1 commit
- [BROKEN wrt shallow clones] Ignore graft during object transfer
Cloning or fetching from a repository from grafts did not send objects that are hidden by grafts, but the commits in the resulting repository do need these to pass fsck. This fixes object transfer to ignore grafts.
Another fix is needed to git-prune so that it ignores grafts but treats commits that are mentioned in grafts as reachable.
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 7 commits
- blame: show "previous" information in --porcelain/--incremental format
- git-blame: refactor code to emit "porcelain format" output
+ git-blame --reverse
+ builtin-blame.c: allow more than 16 parents
+ builtin-blame.c: move prepare_final() into a separate function.
+ rev-list --children
+ revision traversal: --children option
The blame that finds where each line in the original lines moved to. This may help a GSoC project that wants to gather statistical overview of the history. The final presentation may need tweaking (see the log message of the commit ""git-blame --reverse" on the series).
The tip two commits are for peeling to see what's behind the blamed commit, which we should be able to separate out into an independent topic from the rest.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
The topics list the commits in reverse chronological order. The topics meant to be merged to the maintenance series have "maint-" in their names.
I think most of the important stuff is already in 'next'. Let's start talking about closing the merge window for 1.6.0.
----------------------------------------------------------------
[New Topics]
* sb/dashless (Sun Jul 13 15:36:15 2008 +0200) 3 commits
- Make usage strings dash-less
- t/: Use "test_must_fail git" instead of "! git"
- t/test-lib.sh: exit with small negagive int is ok with test_must_fail
* mv/dashless (Fri Jul 11 02:12:06 2008 +0200) 4 commits
- make remove-dashes: apply to scripts and programs as well, not just to builtins
- git-bisect: use dash-less form on git bisect log
- t1007-hash-object.sh: use quotes for the test description
- t0001-init.sh: change confusing directory name
* sp/maint-bash-completion-optim (Mon Jul 14 00:22:03 2008 +0000) 1 commit
+ bash completion: Append space after file names have been completed
Early parts are already merged to 'master' and need to be merged down to maint as well, as this is about a "performance bug" that has been with us almost forever.
* ag/rewrite_one (Sat Jul 12 22:00:57 2008 +0400) 1 commit
+ Fix quadratic performance in rewrite_one.
* sp/win (Fri Jul 11 18:52:42 2008 +0200) 3 commits
+ We need to check for msys as well as Windows in add--interactive.
+ Convert CR/LF to LF in tag signatures
+ Fixed text file auto-detection: treat EOF character 032 at the end of file as printable
* js/merge-rr (Sat Jul 12 15:56:19 2008 +0100) 2 commits
+ Move MERGE_RR from .git/rr-cache/ into .git/
+ builtin-rerere: more carefully find conflict markers
* sb/rerere-lib (Wed Jul 9 14:58:57 2008 +0200) 2 commits
+ rerere: Separate libgit and builtin functions
+ builtin-rerere: more carefully find conflict markers
* ls/mailinfo (Sun Jul 13 20:30:12 2008 +0200) 3 commits
- git-mailinfo: use strbuf's instead of fixed buffers
- Add some useful functions for strbuf manipulation.
- Make some strbuf_*() struct strbuf arguments const.
* gi/cherry-cache (Sat Jul 12 20:14:51 2008 -0700) 1 commit
- cherry: cache patch-ids to avoid repeating work
This does not seem to pass tests even on its own.
* js/maint-pretty-mailmap (Sat Jul 12 00:28:18 2008 +0100) 1 commit
+ Add pretty format %aN which gives the author name, respecting .mailmap
* js/more-win (Sun Jul 13 22:31:23 2008 +0200) 6 commits
- Allow add_path() to add non-existent directories to the path
- Allow the built-in exec path to be relative to the command invocation path
- Fix relative built-in paths to be relative to the command invocation
+ help (Windows): Display HTML in default browser using Windows' shell API
+ help.c: Add support for htmldir relative to git_exec_path()
+ Move code interpreting path relative to exec-dir to new function system_path()
The earlier parts are obvious; Dscho seemed to have some comments on the later ones that are in 'pu'.
* lw/gitweb (Fri Jul 11 03:11:48 2008 +0200) 3 commits
- gitweb: use new Git::Repo API, and add optional caching
- Add new Git::Repo API
- gitweb: add test suite with Test::WWW::Mechanize::CGI
This does not pass t9710, at least for me X-<.
----------------------------------------------------------------
[Will merge to master soon]
* jc/rebase-orig-head (Tue Jul 8 00:12:22 2008 -0400) 2 commits
+ Documentation: mention ORIG_HEAD in am, merge, and rebase
+ Teach "am" and "rebase" to mark the original position with ORIG_HEAD
* jc/branch-merged (Tue Jul 8 17:55:47 2008 -0700) 3 commits
+ branch --merged/--no-merged: allow specifying arbitrary commit
+ branch --contains: default to HEAD
+ parse-options: add PARSE_OPT_LASTARG_DEFAULT flag
This builds on top of the parse-options enhancement series that has been cooking in 'next' for some time.
* om/rerere-careful (Mon Jul 7 14:42:48 2008 +0200) 1 commit
+ builtin-rerere: more carefully find conflict markers
* ls/maint-mailinfo-patch-label (Thu Jul 10 23:41:33 2008 +0200) 1 commit
+ git-mailinfo: Fix getting the subject from the in-body [PATCH] line
----------------------------------------------------------------
[Actively Cooking]
* xx/merge-in-c-into-next (Wed Jul 9 13:51:46 2008 -0700) 4 commits
+ Teach git-merge -X<option> again.
+ Merge branch 'jc/merge-theirs' into xx/merge-in-c-into-next
+ builtin-merge.c: use parse_options_step() "incremental parsing" machinery
+ Merge branch 'ph/parseopt-step-blame' into xx/merge-in-c-into-next
I've described what this is in a separate message.
* rs/imap (Wed Jul 9 22:29:02 2008 +0100) 5 commits
- Documentation: Improve documentation for git-imap-send(1)
- imap-send.c: more style fixes
- imap-send.c: style fixes
- git-imap-send: Support SSL
- git-imap-send: Allow the program to be run from subdirectories of a git tree
Some people seem to prefer having this feature available also with gnutls. If such a patch materializes soon, that would be good, but otherwise I'll merge this as-is to 'next'. Such an enhancement can be done in-tree on top of this series.
* jc/merge-theirs (Mon Jun 30 22:18:57 2008 -0700) 5 commits
+ Make "subtree" part more orthogonal to the rest of merge- recursive.
+ Teach git-pull to pass -X<option> to git-merge
+ Teach git-merge to pass -X<option> to the backend strategy module
+ git-merge-recursive-{ours,theirs}
+ git-merge-file --ours, --theirs
Punting a merge by discarding your own work in conflicting parts but still salvaging the parts that are cleanly automerged. It is likely that this will result in nonsense mishmash, but somehow often people want this, so here they are. The interface to the backends is updated so that you can say "git merge -Xours -Xsubtree=foo/bar/baz -s recursive other" now.
* mv/merge-in-c (Sun Jul 13 08:13:55 2008 +0000) 19 commits
+ reduce_heads(): thinkofix
+ Add a new test for git-merge-resolve
+ t6021: add a new test for git-merge-resolve
+ Teach merge.log to "git-merge" again
+ Build in merge
+ Fix t7601-merge-pull-config.sh on AIX
+ git-commit-tree: make it usable from other builtins
+ Add new test case to ensure git-merge prepends the custom merge message
+ Add new test case to ensure git-merge reduces octopus parents when possible
+ Introduce reduce_heads()
+ Introduce get_merge_bases_many()
+ Add new test to ensure git-merge handles more than 25 refs.
+ Introduce get_octopus_merge_bases() in commit.c
+ git-fmt-merge-msg: make it usable from other builtins
+ Move read_cache_unmerged() to read-cache.c
+ Add new test to ensure git-merge handles pull.twohead and pull.octopus
+ Move parse-options's skip_prefix() to git-compat-util.h
+ Move commit_list_count() to commit.c
+ Move split_cmdline() to alias.c
Sverre seems to have a yet another fixup on top of this that came late and I haven't looked at.
----------------------------------------------------------------
[Graduated to "master"]
* js/pick-root (Fri Jul 4 16:19:52 2008 +0100) 1 commit
+ Allow cherry-picking root commits
* ab/bundle (Sat Jul 5 17:26:40 2008 -0400) 1 commit
+ Teach git-bundle to read revision arguments from stdin like git- rev-list.
* sg/stash-k-i (Tue Jul 8 00:40:56 2008 -0700) 2 commits
+ Documentation: tweak use case in "git stash save --keep-index"
+ stash: introduce 'stash save --keep-index' option
One weakness of our "partial commit" workflow support used to be that the user can incrementally build what is to be committed in the index but that state cannot be tested as a whole in the working tree. This allows you to temporarily stash the remaining changes in the working tree so that the index state before running "stash save --keep-index" can be seen in the working tree to be tested and then committed.
* am/stash-branch (Mon Jul 7 02:50:10 2008 +0530) 2 commits
+ Add a test for "git stash branch"
+ Implement "git stash branch <newbranch> <stash>"
Creates a new branch out of the stashed state, after returning from the interrupt that forced you to create the stash in the first place.
* tr/add-i-e (Thu Jul 3 00:00:00 2008 +0200) 3 commits
+ git-add--interactive: manual hunk editing mode
+ git-add--interactive: remove hunk coalescing
+ git-add--interactive: replace hunk recounting with apply --recount
Adds 'e/dit' action to interactive add command.
* jc/report-tracking (Sun Jul 6 02:54:56 2008 -0700) 5 commits
+ branch -r -v: do not spit out garbage
+ stat_tracking_info(): clear object flags used during counting
+ git-branch -v: show the remote tracking statistics
+ git-status: show the remote tracking statistics
+ Refactor "tracking statistics" code used by "git checkout"
Makes the "your branch is ahead of the tracked one by N commits" logic and messages available to other commands; status and branch are updated.
* ph/parseopt-step-blame (Wed Jul 9 23:38:34 2008 +0200) 18 commits
+ revisions: refactor handle_revision_opt into parse_revision_opt.
+ git-shortlog: migrate to parse-options partially.
+ git-blame: fix lapsus
+ git-blame: migrate to incremental parse-option [2/2]
+ git-blame: migrate to incremental parse-option [1/2]
+ revisions: split handle_revision_opt() from setup_revisions()
+ Merge branch 'jc/blame' (early part) into HEAD
+ parse-opt: add PARSE_OPT_KEEP_ARGV0 parser option.
+ parse-opt: fake short strings for callers to believe in.
+ parse-opt: do not print errors on unknown options, return -2 intead.
+ parse-opt: create parse_options_step.
+ parse-opt: Export a non NORETURN usage dumper.
+ parse-opt: have parse_options_{start,end}.
+ git-blame --reverse
+ builtin-blame.c: allow more than 16 parents
+ builtin-blame.c: move prepare_final() into a separate function.
+ rev-list --children
+ revision traversal: --children option
Became active again ;-) This probably is ready for 'master' already, except for the last two which I only looked at the patch and have not used heavily in production yet.
----------------------------------------------------------------
[On Hold]
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config variables
This was previously in "will be in master soon" category, but it turns out that the synonyms to the ones this one deletes are fairly new invention that happend in 1.5.6 timeframe, and we cannot do this just yet. Perhaps in 1.7.0.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0 timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly asked for
This would be the right thing to do for command line use, but gitk will be hit due to tcl/tk's limitation, so I am holding this back for now.
----------------------------------------------------------------
[Stalled/Needs more work]
* sb/sequencer (Tue Jul 1 04:38:34 2008 +0200) 4 commits . Migrate git-am to use git-sequencer
. Add git-sequencer test suite (t3350)
. Add git-sequencer prototype documentation
. Add git-sequencer shell prototype
* jc/grafts (Wed Jul 2 17:14:12 2008 -0700) 1 commit
- [BROKEN wrt shallow clones] Ignore graft during object transfer
Cloning or fetching from a repository from grafts did not send objects that are hidden by grafts, but the commits in the resulting repository do need these to pass fsck. This fixes object transfer to ignore grafts.
Another fix is needed to git-prune so that it ignores grafts but treats commits that are mentioned in grafts as reachable.
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 2 commits
- blame: show "previous" information in --porcelain/--incremental format
- git-blame: refactor code to emit "porcelain format" output
This is for peeling to see what's behind the blamed commit, which may or may not help applications like gitweb.
Quoted 4 lines · Junio C Hamano
* lw/gitweb (Fri Jul 11 03:11:48 2008 +0200) 3 commits
- Add newGit::RepoAPIThis does not pass t9710, at least for me X-<.
Yikes; I thought I had removed all instanced of Carp::Always (which I had put in for development), but this one apparently slipped through. It'll be fixed in the next version I post (which will also have the dependency on the non-core Test::Exception package removed).
Quoted 1 line · Lea Wiemann
It'll be fixed in the next version I post
By the way Junio, how do you prefer to get reposts of patch sequences? Should I repost the whole sequence under a new common parent message, or can I simply post v2 of each patch in the sequence as a followup to its respective v1?
Quoted 7 lines · Lea Wiemann
Quoted 1 line · Lea Wiemann
It'll be fixed in the next version I post
By the way Junio, how do you prefer to get reposts of patch sequences? Should I repost the whole sequence under a new common parent message, or can I simply post v2 of each patch in the sequence as a followup to its respective v1?
I do not have major preference either way, but for a long series, I'd prefer a resend to be independent from the previous series, i.e.
[PATCH 0/3]
.[PATCH 1/3]
..[PATCH 2/3]
...[PATCH 3/3]
[PATCH 0/4 v2]
.[PATCH 1/4 v2]
..[PATCH 2/4 v2]
...[PATCH 3/4 v2]
....[PATCH 4/4 v2]I can live with the first one from the new series being a follow-up to the first one from the old series, i.e.:
[PATCH 0/3]
.[PATCH 1/3]
..[PATCH 2/3]
...[PATCH 3/3]
.[PATCH 0/4 v2]
..[PATCH 1/4 v2]
...[PATCH 2/4 v2]
....[PATCH 3/4 v2]
.....[PATCH 4/4 v2]but _not_ with this, i.e. N/M being followup to old N/M:
[PATCH 0/3]
.[PATCH 0/4 v2]
.[PATCH 1/3]
..[PATCH 1/4 v2]
..[PATCH 2/3]
...[PATCH 2/4 v2]
...[PATCH 3/3]
....[PATCH 3/4 v2]
.....[PATCH 4/4 v2]Quoted 10 lines · Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
<snip>
* gi/cherry-cache (Sat Jul 12 20:14:51 2008 -0700) 1 commit
- cherry: cache patch-ids to avoid repeating workThis does not seem to pass tests even on its own.
The problem (beyond the basic problem of me not having tried running the tests) is that the current caching code isn't taking into account the changing values of diff_options. t6007 computes a patch-id for a commit with one value of options.paths, and then tries to compute a _different_ patch-id for the same commit using a different value of options.paths.
Here are a few different ways of fixing this:
1. Modify commit_patch_id in patch-ids.c to compute a sha1 of the diff_options structure and xor it with the commit sha1 to get a truly unique hash of the input. This means the optimization can be safely applied for all patch-id computations regardless of the diff_options. I can add a diff_options_sha1 function in diff.[ch] to compute the checksum.
2. Restrict commit_patch_id in patch-ids.c to apply the optimization only if options.nr_paths is zero, and perhaps a few other conditions. This is rather fragile, since it would mean that the cache would break if someone decided to change the default diff options.
3. Add a flag in struct patch_ids defaulting to false which turns the caching on or off, and manually set the flag to true in cmd_cherry.
I'd lean towards (1), but wanted to check before writing the code to make sure that it's reasonable to treat diff_options as stable enough that computing a sha1 hash of it makes sense. According to "git help patch-id", it is only "reasonable stable", which is sufficient as long as we're confident that whenever the diff format changes, the diff_options_sha1 function will be updated to reflect that change.
As an aside: is it correct that as long as the change is in pu, I should be submitting complete (nonincremental) patches whenever I fix bugs?
Thanks,
Geoffrey
Hi,
Quoted 15 lines · Geoffrey Irving
The problem (beyond the basic problem of me not having tried running the tests) is that the current caching code isn't taking into account the changing values of
diff_options. t6007 computes a patch-id for a commit with one value of options.paths, and then tries to compute a _different_ patch-id for the same commit using a different value of options.paths.Here are a few different ways of fixing this:
1. Modify
commit_patch_idinpatch-ids.cto compute a sha1 of thediff_optionsstructure and xor it with the commit sha1 to get a truly unique hash of the input. This means the optimization can be safely applied for all patch-id computations regardless of thediff_options. I can add adiff_options_sha1function in diff.[ch] to compute the checksum.
Quoted 4 lines
2. Restrict
commit_patch_idinpatch-ids.cto apply the optimization only if options.nr_paths is zero, and perhaps a few other conditions. This is rather fragile, since it would mean that the cache would break if someone decided to change the default diff options.
Funnily, (2) contradicts (1). The patch id is _different_ when you have nr_paths > 0. At least in the general case.
So what you propose in (1) will not work, unless you also hash the path names (in the correct order, otherwise you'll end up with two hashes).
OTOH I would be really surprised if you needed --cherry-pick with paths and/or diff options more than once for the same commits. So the caching does not make sense to begin with (especially since we do not have a proper way of gc'ing it, right?).
So I'd suggest saving diff_opts before the command line parsing, and disable the cache when it is different _and/or_ (||) nr_paths.
Ciao,
Dscho
Quoted 24 lines · Johannes Schindelin
Hi,
Quoted 15 lines · Geoffrey Irving
The problem (beyond the basic problem of me not having tried running the tests) is that the current caching code isn't taking into account the changing values of
diff_options. t6007 computes a patch-id for a commit with one value of options.paths, and then tries to compute a _different_ patch-id for the same commit using a different value of options.paths.Here are a few different ways of fixing this:
1. Modify
commit_patch_idinpatch-ids.cto compute a sha1 of thediff_optionsstructure and xor it with the commit sha1 to get a truly unique hash of the input. This means the optimization can be safely applied for all patch-id computations regardless of thediff_options. I can add adiff_options_sha1function in diff.[ch] to compute the checksum.Quoted 4 lines
2. Restrict
commit_patch_idinpatch-ids.cto apply the optimization only if options.nr_paths is zero, and perhaps a few other conditions. This is rather fragile, since it would mean that the cache would break if someone decided to change the default diff options.
Quoted 5 lines
Funnily, (2) contradicts (1). The patch id is _different_ when you have
nr_paths> 0. At least in the general case.So what you propose in (1) will not work, unless you also hash the path names (in the correct order, otherwise you'll end up with two hashes).
The sha1 would include paths, of course, since it's part of diff_options.
Quoted 7 lines
OTOH I would be really surprised if you needed --cherry-pick with paths and/or diff options more than once for the same commits. So the caching does not make sense to begin with (especially since we do not have a proper way of gc'ing it, right?).
So I'd suggest saving
diff_optsbefore the command line parsing, and disable the cache when it is different _and/or_ (||)nr_paths.
I'll attach the patch to the other thread.
Geoffrey
Quoted 6 lines · Junio C Hamano
* lw/gitweb (Fri Jul 11 03:11:48 2008 +0200) 3 commits
- gitweb: use newGit::RepoAPI, and add optional caching
- Add newGit::RepoAPI
- gitweb: add test suite withTest::WWW::Mechanize::CGIThis does not pass t9710, at least for me X-<.
This is getting a bit boring and tiresome. Obviously I haven't checked what _else_ is missing because I did not install Carp::Always myself to my system.
t/t9710-perl-git-repo.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
t/t9710-perl-git-repo.sh +2 -2
@@ -6,8 +6,8 @@ test_description='perl interface (Git/*.pm)' . ./test-lib.sh -perl -MTest::More -e 0 2>/dev/null || { - say_color skip "Perl Test::More unavailable, skipping test" +perl -MTest::More -MTest::Exception -MCarp::Always -e 0 2>/dev/null || { + say_color skip "Perl Test::{More,Exception}, Carp::Always unavailable, skipping test" test_done }
Closing the merge window for 1.6.0
In reply to Junio C HamanoQuoted 2 lines · Junio C Hamano
I think most of the important stuff is already in 'next'. Let's start talking about closing the merge window for 1.6.0.
I think by the time we declare -rc0, we will have merged everything we have in "Actively Cooking" list from tonight, perhaps except for the "merge -Xtheirs", as there do not seem to be wide support for this feature. All the Windows bits and myriad of s/git-foo/git foo/ patches submitted over the weekend and queued in next/pu, and various smallish topics in "New Topics" list will hopefully all appear in 1.6.0.
In essence, I am saying that the merge window is more-or-less closed, from the point of view of "what will be in, and what won't be"; of course some of the topics may not be merged in their current shape without further fixes.
The reason I say more-or-less is because I am aware of a handful of patches that are not even in 'pu' yet:
* A few patches from Mark Levedahl on git-submodule are still held in my inbox; I haven't decided what to do with them.
Date: Wed, 9 Jul 2008 21:05:40 -0400
Subject: [PATCH] git-submodule - make "submodule add" more strict, and document it
Message-Id: <[email protected]>
Date: Wed, 9 Jul 2008 21:05:41 -0400
Subject: [PATCH] git-submodule - register submodule URL if adding in place
Message-ID: <[email protected]>These two appeared at the end of a discussion, and as far as I can see, there wasn't any objection to them. Unless somebody makes a convincing argument against them, I am inclined to include them in 1.6.0
* Starting bisect with a forked good and bad pair, from Christian Couder, is not queued yet. I think it is just the matter of Christian resending the two patches squashed (or me applying them while squashing them myself) --- I was busy cutting 1.5.6.3 release and tending other topics, and haven't got around to do so.
Date: Thu, 10 Jul 2008 05:41:52 +0200
Subject: [PATCH] bisect: test merge base if good rev is not an ancestor of bad rev
Message-Id: <[email protected]>* Alice and Bob prompt in tutorial, from Ian Katz, is not queued; they should be safe to directly apply to 'master'. The only reason why I haven't is because it takes a lot of time to generate and concentration to eyeball the documentation markups to catch mistakes.
Date: Thu, 10 Jul 2008 14:27:30 -0400
Subject: Re: [PATCH] tutorial: prefix the prompts with names alice or bob,
to make it clear who is doing what
Message-ID: <[email protected]>
Subject: [PATCH] tutorial: clarify "pull" is "fetch + merge"
Date: Thu, 10 Jul 2008 14:01:57 -0700
Message-ID: <[email protected]>
* A git-svn patch from João Abecasis; I am waiting for Eric to act on it.
Subject: [PATCH] git-svn: find-rev and rebase for SVN::Mirror repositories
Date: Wed, 9 Jul 2008 03:08:27 +0100
Message-ID: <[email protected]>Here is the draft release notes as of tonight.
----------------------------------------------------------------
GIT v1.6.0 Release Notes (draft)
================================
User visible changes
--------------------
With the default Makefile settings, most of the programs are now installed outside your $PATH, except for "git", "gitk", "git-gui" and some server side programs that need to be accessible for technical reasons. Invoking a git subcommand as "git-xyzzy" from the command line has been deprecated since early 2006 (and officially announced in 1.5.4 release notes); use of them from your scripts after adding output from "git --exec-path" to the $PATH is still supported in this release, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
Source changes needed for porting to MinGW environment are now all in the main git.git codebase.
By default, packfiles created with this version uses delta-base-offset encoding introduced in v1.4.4. Pack idx files are using version 2 that allows larger packs and added robustness thanks to its CRC checking, introduced in v1.5.2.
GIT_CONFIG, which was only documented as affecting "git config", but actually affected all git commands, now only affects "git config". GIT_LOCAL_CONFIG, also only documented as affecting "git config" and not different from GIT_CONFIG in a useful way, is removed.
An ancient merge strategy "stupid" has been removed.
Updates since v1.5.6
--------------------
(subsystems)
* git-p4 in contrib learned "allowSubmit" configuration to control on which branch to allow "submit" subcommand.
* git-gui learned to stage changes per-line.
(portability)
* Changes for MinGW port have been merged, thanks to Johannes Sixt and gangs.
* Sample hook scripts shipped in templates/ are now suffixed with *.sample. We used to prevent them from triggering by default by relying on the fact that we install them as unexecutable, but on some filesystems this approach does not work. Instead of running "chmod +x" on them, the users who want to activate these samples as-is can now rename them dropping *.sample suffix.
* perl's in-place edit (-i) does not work well without backup files on Windows; some tests are rewritten to cope with this.
(documentation)
* Updated howto/update-hook-example
* Got rid of usage of "git-foo" from the tutorial and made typography more consistent.
* Disambiguating "--" between revs and paths is finally documented.
(performance, robustness, sanity etc.)
* even more documentation pages are now accessible via "man" and "git help".
* reduced excessive inlining to shrink size of the "git" binary.
* verify-pack checks the object CRC when using version 2 idx files.
* When an object is corrupt in a pack, the object became unusable even when the same object is available in a loose form, We now try harder to fall back to these redundant objects when able. In particular, "git repack -a -f" can be used to fix such a corruption as long as necessary objects are available.
* git-clone does not create refs in loose form anymore (it behaves as if you immediately ran git-pack-refs after cloning). This will help repositories with insanely large number of refs.
* core.fsyncobjectfiles configuration can be used to ensure that the loose objects created will be fsync'ed (this is only useful on filesystems that does not order data writes properly).
* "git commit-tree" plumbing can make Octopus with more than 16 parents. "git commit" has been capable of this for quite some time.
(usability, bells and whistles)
* A new environment variable GIT_CEILING_DIRECTORIES can be used to stop the discovery process of the toplevel of working tree; this may be useful when you are working in a slow network disk and are outside any working tree, as bash-completion and "git help" may still need to run in these places.
* By default, stash entries never expire. Set reflogexpire in [gc "refs/stash"] to a reasonable value to get traditional auto-expiration behaviour back
* Longstanding latency issue with bash completion script has been addressed. This will need to be backmerged to 'maint' later.
* pager.<cmd> configuration variable can be used to enable/disable the default paging behaviour per command.
* "git-add -i" has a new action 'e/dit' to allow you edit the patch hunk manually.
* git-apply can handle a patch that touches the same path more than once much better than before.
* git-apply can be told not to trust the line counts recorded in the input patch but recount, with the new --recount option.
* git-apply can be told to apply a patch to a path deeper than what the patch records with --directory option.
* git-archive can be told to omit certain paths from its output using export-ignore attributes.
* With -v option, git-branch describes the remote tracking statistics similar to the way git-checkout reports by how many commits your branch is ahead/behind.
* git-bundle can read the revision arguments from the standard input.
* git-cherry-pick can replay a root commit now.
* git-clone can clone from a remote whose URL would be rewritten by configuration stored in $HOME/.gitconfig now.
* git-diff --check now checks leftover merge conflict markers.
* When remote side used to have branch 'foo' and git-fetch finds that now it has branch 'foo/bar', it refuses to lose the existing remote tracking branch and its reflog. The error message has been improved to suggest pruning the remote if the user wants to proceed and get the latest set of branches from the remote, including such 'foo/bar'.
* fast-export learned to export and import marks file; this can be used to interface with fast-import incrementally.
* "git rerere" can be told to update the index with auto-reused resolution with rerere.autoupdate configuration variable.
* git-rev-list learned --children option to show child commits it encountered during the traversal, instead of shoing parent commits.
* git-send-mail can talk not just over SSL but over TLS now.
* "git-stash save" learned --keep-index option. This lets you stash away the local changes and bring the changes staged in the index to your working tree for examination and testing.
* git-stash also learned branch subcommand to create a new branch out of stashed changes.
* git-status gives the remote tracking statistics similar to the way git-checkout reports by how many commits your branch is ahead/behind.
* You can tell "git status -u" to even more aggressively omit checking untracked files with --untracked-files=no.
* Original SHA-1 value for "update-ref -d" is optional now.
* Error codes from gitweb are made more descriptive where possible, rather than "403 forbidden" as we used to issue everywhere.
(internal)
Fixes since v1.5.6
------------------
All of the fixes in v1.5.6 maintenance series are included in this release, unless otherwise noted.
* "git fetch" into an empty repository used to remind the fetch will be huge by saying "no common commits", but it is already known by the user anyway (need to backport 8cb560f to 'maint').
---
exec >/var/tmp/1
O=v1.5.6.3-315-g10ce020
echo O=$(git describe refs/heads/master)
git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint
Re: Closing the merge window for 1.6.0
Quoted 4 lines · Junio C Hamano
By default, packfiles created with this version uses delta-base-offset encoding introduced in v1.4.4. Pack idx files are using version 2 that allows larger packs and added robustness thanks to its CRC checking, introduced in v1.5.2.
Oh, I thought this was some earlier change when I noticed it few days ago on repo.or.cz, but seems there is still a chance to turn this over - please reconsider...? :-)
Can't we by default use the version 2 only in case we actually _need_ to store the larger packs? The CRC checking may be nice, but not critical, and we could wait a bit more with it yet.
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs:
Getting alternates list for http://repo.or.cz/r/repo.git/
Getting pack list for http://repo.or.cz/r/repo.git/
Getting index for pack 5111285cac0f895cd9367c9939ced68e2c43dcc0
error: non-monotonic index/usr/bin/git-fetch: line 297: 30402 Segmentation fault git-http-fetch -v -a "$head" "$remote/"
P.S.: AFAIK new Debian stable release is scheduled on Fall.
Signature · 4 lines
Petr "Pasky" Baudis GNU, n. An animal of South Africa, which in its domesticated state resembles a horse, a buffalo and a stag. In its wild condition it is something like a thunderbolt, an earthquake and a cyclone. -- A. Pierce
Re: Closing the merge window for 1.6.0
Quoted 5 lines · Petr Baudis
Getting alternates list for http://repo.or.cz/r/repo.git/
Getting pack list for http://repo.or.cz/r/repo.git/
Getting index for pack5111285cac0f895cd9367c9939ced68e2c43dcc0
error: non-monotonic index/usr/bin/git-fetch: line 297: 30402 Segmentation fault git-http-fetch -v -a "$head" "$remote/"
Yeah, I think git-repack, git-gc, git-pack-objects and git-index-pack on the server side need a knob to tell it to stay conservative because the repository may be served over dumb protocols to avoid this problem.
That knob could even be called
[repack]
usedeltabaseoffset = false
[pack]
indexversion = 1
Re: Closing the merge window for 1.6.0
Quoted 10 lines · Junio C Hamano
Yeah, I think git-repack, git-gc, git-pack-objects and git-index-pack on the server side need a knob to tell it to stay conservative because the repository may be served over dumb protocols to avoid this problem.
That knob could even be called
[repack]
usedeltabaseoffset = false
[pack]
indexversion = 1
Can you please mention this in release notes? Until now, I actually thought you're speaking about a hypothetical improvement, not a knob we actually have. :-) (BTW, turning off the usedeltabaseoffset is not critical at least Debian-wise, and I think that really is the oldest Git in widespread use.)
Now, there is of course still the issue of default behaviour, but at least my concern is somewhat eased now. :-)
Signature · 4 lines
Petr "Pasky" Baudis GNU, n. An animal of South Africa, which in its domesticated state resembles a horse, a buffalo and a stag. In its wild condition it is something like a thunderbolt, an earthquake and a cyclone. -- A. Pierce
Re: Closing the merge window for 1.6.0
In reply to Petr BaudisHi,
Quoted 5 lines · Petr Baudis
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs.
Can't we just hit Debian's Git maintainer with a clue bat or a bus, whichever is easier, and force them to upgrade _in_ Etch? It's not like we haven't had _several_ stable releases in-between.
Ciao,
Dscho
Re: Closing the merge window for 1.6.0
Quoted 8 lines · Johannes Schindelin
Quoted 5 lines · Petr Baudis
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs.
Can't we just hit Debian's Git maintainer with a clue bat or a bus,
Please don't. It wouldn't help, rather the opposite I think, espacially the bus. We don't introduce new upstream versions into a Debian stable release, there's a great effort done for each stable release to reach high quality integration of all the software packages available in Debian. Once that status is reached, only security fixes and criticial usability fixes are added.
The freeze of the packages for the next stable release is planned a few days from now, so it looks like Debian 'lenny' will include git 1.5.6.x.
Regards, Gerrit.
Re: Closing the merge window for 1.6.0
Hi,
Quoted 8 lines · Gerrit Pape
Quoted 7 lines · Johannes Schindelin
Quoted 5 lines · Petr Baudis
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs.
Quoted 4 lines
Quoted 1 line
Can't we just hit Debian's Git maintainer with a clue bat or a bus,
Please don't. It wouldn't help, rather the opposite I think, espacially the bus.
Heh. It was a feeble attempt at humor production ;-)
Quoted 5 lines
We don't introduce new upstream versions into a Debian stable release, there's a great effort done for each stable release to reach high quality integration of all the software packages available in Debian. Once that status is reached, only security fixes and criticial usability fixes are added.
If that is the case, we might need to think about fixing that segmentation fault to 1.4.4.5... Which would be a minor pain in the donkey, I guess.
Quoted 4 lines
The freeze of the packages for the next stable release is planned a few days from now, so it looks like Debian 'lenny' will include git 1.5.6.x.
From my memories of IRC, it seems that quite a few people do not even
consider upgrading.
Ciao,
Dscho
Re: Closing the merge window for 1.6.0
In reply to Gerrit PapeQuoted 8 lines · Gerrit Pape
Quoted 7 lines · Johannes Schindelin
Quoted 5 lines · Petr Baudis
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs.
Quoted 8 lines
Quoted 1 line
Can't we just hit Debian's Git maintainer with a clue bat or a bus,
Please don't. It wouldn't help, rather the opposite I think, espacially the bus. We don't introduce new upstream versions into a Debian stable release, there's a great effort done for each stable release to reach high quality integration of all the software packages available in Debian. Once that status is reached, only security fixes and criticial usability fixes are added.
Please consider it as a critical usability problem.
Maybe we can release 1.4.5 with the ability to read index v2? That wouldn't be hard to backport the reading part of it.
Nicolas
Re: Closing the merge window for 1.6.0
Quoted 4 lines · Nicolas Pitre
Quoted 2 lines · Gerrit Pape
Quoted 1 line · Johannes Schindelin
On Mon, 14 Jul 2008, Petr Baudis wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs.
Maybe we can release 1.4.5 with the ability to read index v2? That wouldn't be hard to backport the reading part of it.
If we consider that supporting 1.4.4.4 clients is still a priority, due to the widespread distribution of that version in a popular version of Debian, we shouldn't be rushing the index v2 or OFS_DELTA functionality on by default in 1.6.0. Instead we would wait until Debian stable (and most other widely popular distributions) are on a modern enough version of Git to understand this format.
Really. As much as I'd love to see the switch to v2 made by default I don't think we can/should do it unless the majority of the user base will be able to grok it. And Debian etch sounds like it won't.
Signature · 1 line
Shawn.
Re: Closing the merge window for 1.6.0
Quoted 11 lines · Shawn O. Pearce
Quoted 10 lines · Nicolas Pitre
Quoted 7 lines · Gerrit Pape
Quoted 6 lines · Johannes Schindelin
Quoted 5 lines · Petr Baudis
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs.
Quoted 7 lines
Quoted 2 lines
Maybe we can release 1.4.5 with the ability to read index v2? That wouldn't be hard to backport the reading part of it.
If we consider that supporting 1.4.4.4 clients is still a priority, due to the widespread distribution of that version in a popular version of Debian, we shouldn't be rushing the index v2 or
OFS_DELTAfunctionality on by default in 1.6.0.
OFS_DELTA is supported by 1.4.4.4 so that's a non issue.
Quoted 3 lines
Instead we would wait until Debian stable (and most other widely popular distributions) are on a modern enough version of Git to understand this format.
I don't think we should have git development be dictated by some discutable policy from one distribution.
IMHO git prior 1.5.0 is so horrible as general usability goes, and so different from what everybody is discussing on the net, that no one sane should still be using it. Even ourselves (i.e. the git community) are not supporting git 1.4.4 anymore so this hardly can be a priority.
As far as I know, there is no other widely popular distribution other than Debian using git prior 1.5.0 in their latest release. If Debian people want to support git 1.4.4 although we called thatversion obsolete _long_ ago then that's their problem. We should not be bound by that external policy to which we never agreed with.
Now I proposed a compromise which consists of making 1.4.4.4+1 able to cope with index v2. That should fall into Debian's "major usability fix" category. I think that is a far better compromize than delaying index v2 even further.
Quoted 3 lines
Really. As much as I'd love to see the switch to v2 made by default I don't think we can/should do it unless the majority of the user base will be able to grok it. And Debian etch sounds like it won't.
I truly hope the majority of the user is _not_ using 1.4.4.4. Otherwise I may only have pity for them.
Nicolas
Re: Closing the merge window for 1.6.0
In reply to Nicolas PitreQuoted 19 lines · Nicolas Pitre
Quoted 8 lines · Gerrit Pape
Quoted 7 lines · Johannes Schindelin
Quoted 5 lines · Petr Baudis
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs.
Quoted 8 lines
Quoted 1 line
Can't we just hit Debian's Git maintainer with a clue bat or a bus,
Please don't. It wouldn't help, rather the opposite I think, espacially the bus. We don't introduce new upstream versions into a Debian stable release, there's a great effort done for each stable release to reach high quality integration of all the software packages available in Debian. Once that status is reached, only security fixes and criticial usability fixes are added.
Quoted 4 lines
Please consider it as a critical usability problem.
Maybe we can release 1.4.5 with the ability to read index v2? That wouldn't be hard to backport the reading part of it.
I am of two minds here.
On one hand, I am sympathetic to distros that want to give long time support for ancient versions to keep working in an ever-changing new world. It is a wonderful thing that there are distros that aim for ultra conservative stability, and I applaud them.
But as the upstream, we have our own deprecation schedule. We should of course plan carefully not to harm existing users of our releases, but frankly speaking, 18 months since 1.4.4.4 was tagged (early January 2007) is an eternity in git timescale. Maybe we will slow down someday, and this 18-month is not a set-in-stone rule in any way, but at this point even without the packfile format issues, I personally think anything before 1.5.0 is irrelevant --- maybe they are interesting as historical curiosities, but not more than that.
We could:
$ git checkout -b maint-1.4 v1.4.4.4
$ git merge maint
$ git tag v1.4.4.5and push the result out. While I would imagine that the end-user experience after such a maintenance release would be very positive, that is not something distros who really want to stay with a stale version for a good reason would want to swallow ;-).
If we _were_ to keep v1.4.4.X series alive, serious backporting efforts will be necessary. For example, recent 'git-shell' futureproofing was made not just to 1.5.6.X series but was backported to 1.5.4.X and 1.5.5.X, and we would probably need to give it to 1.4.4.X as well. What other things are there that are missing in 1.4.4.X? It would take nontrivial engineering resource to even list them, let alone assessing how much effort is required for such backporting and actually doing it.
The remotes/ layout, use of "git-add" for new contents (instead of only new files), reflogs, detached HEAD, --pretty=format:%<blah>, bundles, mergetool,... all the things that a modern git workflow revolves around and are described in the user manuals the users find on the net are not found in 1.4.4.X series. If a user of such a conservative distro needs to work with a repository prepared on another platform with newer git, perhaps crossmounted, should we backport "git branch -r" so that the user can confortably work with remote tracking branches? Should we backport reflogs?
If a distro chooses to support its users whom they force to pin at 1.4.4.X series, it's primarily _their_ choice. I do not mind helping them in such a backport, but the request has to come from the distro first with a specific list of items that need to be supported.
Re: Closing the merge window for 1.6.0
Junio C Hamano wrote (2008-07-14 12:00 -0700):
Quoted 14 lines
Quoted 11 lines · Nicolas Pitre
Quoted 4 lines · Gerrit Pape
Quoted 4 lines · Petr Baudis
Quoted 3 lines
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets
Please consider it as a critical usability problem.
Maybe we can release 1.4.5 with the ability to read index v2? That wouldn't be hard to backport the reading part of it.
Quoted 8 lines
I am of two minds here.
On one hand, I am sympathetic to distros that want to give long time support for ancient versions to keep working in an ever-changing new world. It is a wonderful thing that there are distros that aim for ultra conservative stability, and I applaud them.
But as the upstream, we have our own deprecation schedule.
As Debian stable (4.0 "Etch") and its git 1.4.4.4 was mentioned I'd like to point out that git 1.5.6 is available for Etch users from kind-of-semi-official <www.backports.org>. So I guess Debian stable users aren't left completely behind. Git's web page already advertises backports.org version for Etch.
Re: Closing the merge window for 1.6.0
Quoted 7 lines · Teemu Likonen
Quoted 1 line
But as the upstream, we have our own deprecation schedule.
As Debian stable (4.0 "Etch") and its git 1.4.4.4 was mentioned I'd like to point out that git 1.5.6 is available for Etch users from kind-of-semi-official <www.backports.org>. So I guess Debian stable users aren't left completely behind. Git's web page already advertises backports.org version for Etch.
I concur. Users of git on Etch are using backports AFAIK.
We still have the case of the "casual" user, who does not know much about git, but installs it to clone & review a project's code. There, if v1.4.4 complains with a useful message, the casual user will swear a bit and grab a backport. If it dies a horrible uninformative death, then we will get bogus bug reports, flamage, the works.
cheers,
m
Signature · 5 lines
[email protected] [email protected] -- School Server Architect - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff
Re: Closing the merge window for 1.6.0
In reply to Junio C HamanoQuoted 8 lines · Junio C Hamano
But as the upstream, we have our own deprecation schedule. We should of course plan carefully not to harm existing users of our releases, but frankly speaking, 18 months since 1.4.4.4 was tagged (early January 2007) is an eternity in git timescale. Maybe we will slow down someday, and this 18-month is not a set-in-stone rule in any way, but at this point even without the packfile format issues, I personally think anything before 1.5.0 is irrelevant --- maybe they are interesting as historical curiosities, but not more than that.
Really, I think this is should be put into certain perspective:
(i) This change is special since it affects client-server compatibility in bare repositories. AFAIK, none of the others you mention does this.
(ii) The CRC checking is perhaps quite an improvement, but I don't think it is critical-to-have-just-now.
(iii) Most importantly, this is not about waiting another few years for Debian to catch up, since the next stable release should really be upcoming rather soon:
http://debian-community.org/LennyReleaseSchedule/
(iv) These problems do not concern people who are currently _actively_ _working_ with Git; these people hopefully do not use 1.4 willingly and already use Git from backports.org. This is about user experience for casual users who are quite possibly interested only in read-only tracking of upstream using Git - these people will likely use default Debian Git version and that is okay, because frankly, for them, the 1.5 improvements do not really matter much. This is also large class of prospective future real Git users and we might not want to ruin Git's reputation in their eyes.
Signature · 4 lines
Petr "Pasky" Baudis GNU, n. An animal of South Africa, which in its domesticated state resembles a horse, a buffalo and a stag. In its wild condition it is something like a thunderbolt, an earthquake and a cyclone. -- A. Pierce
Re: Closing the merge window for 1.6.0
Quoted 6 lines · Petr Baudis
(iii) Most importantly, this is not about waiting another few years for Debian to catch up, since the next stable release should really be upcoming rather soon:
Even if Lenny will be released right on the scheduler (which I seriously doubt), Etch will be around for another year. In fact, the last release of oldstable (sarge) happened on April 12 this year. Thus delaying of indexversion=2 does not help much here. Anyone who is more or less seriously about using Git grabs it from backports. The downside of delaying is that any incompatible changes are much less welcome by users during minor releases than major ones. People tend to read release notes during major releases more carefully and think whether they prefer new features or backward compatibility. This choice will not be the same for anyone, but changing default settings on the major release is much more appropriate than during minor ones.
Quoted 11 lines
(iv) These problems do not concern people who are currently _actively_ _working_ with Git; these people hopefully do not use 1.4 willingly and already use Git from backports.org. This is about user experience for casual users who are quite possibly interested only in read-only tracking of upstream using Git - these people will likely use default Debian Git version and that is okay, because frankly, for them, the 1.5 improvements do not really matter much. This is also large class of prospective future real Git users and we might not want to ruin Git's reputation in their eyes.
I disagree. It is not Git does not support the old format, but it switches on the new one as default on the next major release, which is a sensible thing to do. Those repos that think that access for Git 1.4 users is important for them can set indexformat=1. As to prospective future real Git users, anyone who is trying to use Git 1.4 is going to hit by many usability issues that were resolved in 1.5; and there is no community support for Git 1.4 either -- you can ask about any problem with Git 1.4 on this list, and the only answer you'll get is that you should upgrade your Git. So, there is no way for newcommers to start using Git 1.4 and be satisfied with it.
Finally, 18 months since 1.4.4 may not appear as a long time ago for other projects that are being developed for many years, but for Git, which was only 21 months when Git 1.4.4 was released, 18 months is really very *long* time ago.
Dmitry
Re: Closing the merge window for 1.6.0
Hi,
Quoted 2 lines · Dmitry Potapov
Those repos that think that access for Git 1.4 users is important for them can set indexformat=1.
Unfortunately, you place quite a high maintenance burden on the repository maintainers here.
Quoted 1 line
From the time balance sheet, it does not look good at all: a few minutes
for Junio to change and commit, up to a few hours (because they missed it in the release notes) for probably more than hundred repository maintainers that are not subscribed to the Git mailing list.
And I absolutely agree with Pasky that this does _nothing_ in the vague direction of wielding a reputation of being easy to use.
Sure, we can make it easy on ourselves. And it is just as easy to make it hard on others. If you're okay with that, I am not.
Ciao,
Dscho
Re: Closing the merge window for 1.6.0
Quoted 5 lines · Johannes Schindelin
Quoted 2 lines
From the time balance sheet, it does not look good at all: a few minutes
for Junio to change and commit, up to a few hours (because they missed it in the release notes) for probably more than hundred repository maintainers that are not subscribed to the Git mailing list.
If you just grab sources and never read release notes, there is nothing that can help you. If Git 1.6.0 is not the right moment to do these changes then Git 1.6.1 is neither, regardless whether Debian will release Lenny by that time or not. People do not upgrade their distro in the day of release. Some upgraded to Etch not so long ago. So, should we wait for another year till 1.7.0?
Quoted 3 lines
And I absolutely agree with Pasky that this does _nothing_ in the vague direction of wielding a reputation of being easy to use.
I don't think Git 1.4 is easy to use. If you want Git that is easy to use install Git 1.5.x. And, it is *much* easier to install Git from backports then to deal with usability issues of Git 1.4 and the lack of community support. So, I don't see how this change may hurt.
Quoted 3 lines
Sure, we can make it easy on ourselves. And it is just as easy to make it hard on others. If you're okay with that, I am not.
It has *nothing* to do with making easy on ourselves and hard on others. The question here is what is the appropriate time to change these default settings, and I believe that *major* releases are the appropriate time while minor ones are not.
Dmitry
Re: Closing the merge window for 1.6.0
In reply to Johannes SchindelinQuoted 11 lines · Johannes Schindelin
Quoted 2 lines · Dmitry Potapov
Those repos that think that access for Git 1.4 users is important for them can set indexformat=1.
Unfortunately, you place quite a high maintenance burden on the repository
maintainers here.From the time balance sheet, it does not look good at all: a few minutes for Junio to change and commit, up to a few hours (because they missed it in the release notes) for probably more than hundred repository maintainers that are not subscribed to the Git mailing list.
To take this in a slightly different direction, what exactly is the benefit of the new feature? Apparently my git doesn't have it enabled by default, and git works fine for me. Am I missing out on something that I should feel inferior about if my non-debian-etch running friends(*) found out about it? :)
Have fun,
Avery
(*) Actually I compile my own git from source anyway. I never want to live without "git rebase -i" and "git add -p" ever again. Life is too short! :)
Re: Closing the merge window for 1.6.0
In reply to Johannes SchindelinQuoted 13 lines · Johannes Schindelin
Quoted 2 lines · Dmitry Potapov
Those repos that think that access for Git 1.4 users is important for them can set indexformat=1.
Unfortunately, you place quite a high maintenance burden on the repository maintainers here.
From the time balance sheet, it does not look good at all: a few minutes for Junio to change and commit, up to a few hours (because they missed it in the release notes) for probably more than hundred repository maintainers that are not subscribed to the Git mailing list.
Quoted 5 lines
And I absolutely agree with Pasky that this does _nothing_ in the vague direction of wielding a reputation of being easy to use.
Sure, we can make it easy on ourselves. And it is just as easy to make it hard on others. If you're okay with that, I am not.
I was not planning to comment on this issue further as the ball is in Debian's court, but I think you are misguided.
We are not making anything hard on others. Sticking to 1.4.4.4 codebase is forced by Debian (for its policy) and choice made by its users (for not knowing or using backports). 1.5.0 and later are vastly better and we encourage users to update on every occassion we get.
I do not know the extent of the backporting effort necessary, the size of potentially impacted population if Debian keeps shipping unpatched 1.4.4.4, nor how much Debian cares about supporting their 1.4.4.4 users i.e. if they are willing and able to carry distro-only forward compatibility patches, and knowing all of these is necessary before we declare this is worth handling _ourselves_. That is why I did not want to take a definitive stance on this issue before hearing from the Debian maintainer about them -- I said "Debian has to ask with list of items", didn't I?
What troubles me the most is that you seem to be forgetting that we are using git to manage our codebase. Even if this turns out to be something we would want to handle ourselves, it does not have to come from me. If you care that much, you could backport whatever change is appropriate to keep 1.4.4.X codebase alive and arrange it to be published as 1.4.4.5.
In any case, it will _definitely_ *NOT* a few minutes of me nor anybody. Release engineering takes quite a lot of time.
Re: Closing the merge window for 1.6.0
Hi,
Quoted 2 lines · Junio C Hamano
What troubles me the most is that you seem to be forgetting that we are using git to manage our codebase.
I don't. I have vivid memories of updating an ancient git repository of Git itself, which had some almost forgotten changes in it. That was in the bad old days, when the version number did not even have a "1" in it.
It could not even fetch the current git.git.
I do _not_ want that to happen to anybody else, _even if_ we leave 1.4.4.4 Behind as if it was an American Child.
Having said that, I do not have the resources to test and fix everything that may arise from Debian being seemingly unable to update to Git 1.5. So I agree completely that the ball is in Debian's half, and if they let it rot, it is sad, but I cannot help it.
Ciao,
Dscho
Re: Closing the merge window for 1.6.0
Quoted 5 lines · Johannes Schindelin
Quoted 2 lines · Junio C Hamano
What troubles me the most is that you seem to be forgetting that we are using git to manage our codebase.
Quoted 8 lines
I don't. I have vivid memories of updating an ancient git repository of Git itself, which had some almost forgotten changes in it. That was in the bad old days, when the version number did not even have a "1" in it.
It could not even fetch the current git.git.
I do _not_ want that to happen to anybody else,
_evenif_we leave 1.4.4.4 Behind as if it was an American Child.
My reference to "git" was about "forking is easy". We seem to have to agree that talking is even cheaper, though ;-)
Quoted 2 lines
Having said that, I do not have the resources to test and fix everything that may arise from Debian being seemingly unable to update to Git 1.5.
Heh, what happent to your earlier "a few minutes for Junio to change and commit"?
Re: Closing the merge window for 1.6.0
Hi,
Quoted 8 lines · Junio C Hamano
Quoted 3 lines · Johannes Schindelin
Having said that, I do not have the resources to test and fix everything that may arise from Debian being seemingly unable to update to Git 1.5.
Heh, what happent to your earlier "a few minutes for Junio to change and commit"?
That was meant for the integration of the patch that makes the backwards-incompatible patch.
Not for the necessary forward-compatible changes.
Ciao,
Dscho
Re: Closing the merge window for 1.6.0
In reply to Johannes SchindelinQuoted 2 lines · Johannes Schindelin
And I absolutely agree with Pasky that this does _nothing_ in the vague direction of wielding a reputation of being easy to use.
Staying with git versions prior 1.5 isn't either. In fact, git had a much harder time with its usability reputation in those days. In other words, if some user of Debian is rebutted by the upgrade path for a later git version, then the awkwardness of git 1.4.4 UI will be even worse.
Anyway this is all hand waving until someone can come with some evidence that git 1.4.4 is actually used by a significant amount of people, and that those people depend on dumb transfer protocols.
Nicolas
Re: Closing the merge window for 1.6.0
Quoted 3 lines · Nicolas Pitre
Anyway this is all hand waving until someone can come with some evidence that git 1.4.4 is actually used by a significant amount of people, and that those people depend on dumb transfer protocols.
That will be hard to produce. :-) _My_ personal story is that I have Git-1.4.4.4 installed system-wide on repo.or.cz and follow git#next locally, and quite panicked when I was inspecting some repositories as root (using the system-wide Git) and these error messages popped up. This may become a similar experience for others on multi-user systems where people want to share work but don't realize that one of them has Git installed locally and the other one doesn't. We can save them the head-slapping and a bit of wasted life.
Out of interest, I did a simple statistics of HTTP user agents on repo.or.cz; the dumb access does not seem very widely used overally, it turns out. The stats begin at 19/May/2008:10:54:32 +0200. Here is the breakdown, counting unique clients only:
# zgrep '"GET /r/.*/info/packs' /var/log/apache2/repo-access.log* | egrep -v bot\|slurp\|Gecko\|Opera |
cut -d " " -f 1,12- | sed 's/\.g[a-f0-9]*\(\.dirty\)*"/"/' | sort -u |
cut -d ' ' -f 2 | sort | uniq -c | sort -rn | head -n 50
1501 "git/1.5.4.3" <- Ubuntu Hardy (heh.. is just that it?)
278 "git/1.5.5.1" <- RHEL5 (ditto)
151 "git/1.5.2.5" <- Ubuntu Gutsy
133 "git/1.5.5.3" <- ? (maybe Gentoo ~x86 for some time)
125 "git/1.5.4.5" <- OpenSUSE 11.0, FC9, Gentoo x86, Dapper backports
104 "git/1.5.6" <- Debian Lenny
94 "git/1.5.5"
66 "git/1.5.3.7"
63 "git/1.5.5.4"
63 "git/1.5.5.1015"
55 "git/1.5.2.4" <- OpenSUSE 10.3
51 "Mozilla/4.0 (compatible;)" <- huh?
42 "git/1.5.3.8"
37 "git/1.5.5.GIT"
37 "git/1.5.3.5.2229"
34 "git/1.5.6.1"
33 "git/1.5.3.6" <- Feisty backports
31 "git/1.5.4.1"
30 "git/1.5.6.2"
20 "git/1.5.6.GIT"
18 "git/1.5.3"
17 "git/1.5.2.2"
17 "git/1.4.4.4"
15 "git/1.5.6.1.1071"
14 "git/1.5.3.3"
13 "git/1.5.4.4"
13 "git/1.5.4"
11 "git/1.5.6.1062"
11 "git/1.5.5.2"
10 "git/1.5.5.1.316"(I also got two 1.4.4.2 (feisty?) fetches from one client. No older Git versions.)
So wrt. keeping backwards compatibility, this is not _very_ convincing, I admit. ;-)
Signature · 4 lines
Petr "Pasky" Baudis GNU, n. An animal of South Africa, which in its domesticated state resembles a horse, a buffalo and a stag. In its wild condition it is something like a thunderbolt, an earthquake and a cyclone. -- A. Pierce
Re: Closing the merge window for 1.6.0
In reply to Nicolas PitreQuoted 3 lines · Nicolas Pitre
Anyway this is all hand waving until someone can come with some evidence that git 1.4.4 is actually used by a significant amount of people, and that those people depend on dumb transfer protocols.
Can't we add a msg to 1.4.4.x when it finds pack version 2 to upgrade to 1.5.x? Gets rid of the problem all together while still giving the user a reasonable message when it finds a repo version 2.
Hey, here's an idea, can't we have 1.4.4.x just give that msg for everything?
$cat git
#!/bin/sh
echo "Please upgrade to 1.5.x, version 1.4.x is no longer supported nor should you even want to use it </cluebat>"
Signature · 3 lines
Cheers, Sverre Rabbelier
Re: Closing the merge window for 1.6.0
In reply to Johannes SchindelinHi,
Quoted 11 lines · Johannes Schindelin
Quoted 5 lines · Petr Baudis
I'm saying this because I believe the best conservative upper bound for backwards compatibility is Git version in Debian stable. It gets probably the most stale from all the widely used software distributions using Git, and it *is* quite widely used. Etch carries v1.4.4.4, which fails miserably on the new packs.
Can't we just hit Debian's Git maintainer with a clue bat or a bus, whichever is easier, and force them to upgrade _in_ Etch? It's not like we haven't had _several_ stable releases in-between.
the whole point of having a stable distribution is that random version
upgrades don't happen under your hands; sure, 1.4.4.4 can have plenty of bugs, but it's buggy in a well-defined way, which is better than upgrade to newer stable version, which may be less buggy, but in a different way; also, by upgrading to newer version you might find various subtle compatibility issues, etc.
Upgrading to newer version, *especially* if it's over then 1.4 - 1.5
boundary, is not something you could seriously expect Debian to do. At least I actually _hope_ so, as a sysadmin of a network of 40 etch workstations.
Signature · 4 lines
Petr "Pasky" Baudis GNU, n. An animal of South Africa, which in its domesticated state resembles a horse, a buffalo and a stag. In its wild condition it is something like a thunderbolt, an earthquake and a cyclone. -- A. Pierce
Re: Closing the merge window for 1.6.0
Quoted 4 lines · Petr Baudis <pasky <at> suse.cz> writes:
Upgrading to newer version, *especially* if it's over then 1.4 - 1.5
boundary, is not something you could seriously expect Debian to do. At least I actually _hope_ so, as a sysadmin of a network of 40 etch workstations.
Perhaps Debian could add a "git1.5" package to the etch repository. That will guarantee that no current etch users of git 1.4.4.4 will be affected, and they can choose if they want, to install git1.5.
Nick.
Re: Closing the merge window for 1.6.0
In reply to Junio C HamanoQuoted 1 line · Junio C Hamano
* git-gui learned to stage changes per-line.
This has usability issues. In particular, it is impossible to stage only the change "old1"->"new1" or unstage the change "old2"->"new2" of this hunk:
@@ -1,4 +1,4 @@ ctxt1 -old1 -old2 +new1 +new2 ctxt2
Being able to do that was one of the goals, and I missed it :-( Since that's my personal itch, I'll come up with a patch rather sooner than later.
-- Hannes
Re: Closing the merge window for 1.6.0
In reply to Junio C HamanoQuoted 6 lines · Junio C Hamano
GIT v1.6.0 Release Notes (draft)
================================* By default, stash entries never expire. Set reflogexpire in [gc "refs/stash"] to a reasonable value to get traditional auto-expiration behaviour back
And, of course, one can set up reflog expiration per ref or per ref type (for example never expiring stash, making expiration for HEAD longer than default, and for remote-tracking branches shorter).
Quoted 2 lines
* git-stash also learned branch subcommand to create a new branch out of stashed changes.
Typography: wouldn't it be better to use "learned 'branch' subcommand"?
Signature · 3 lines
Jakub Narebski Poland ShadeHawk on #git
Hi,
Quoted 12 lines · Junio C Hamano
* js/more-win (Sun Jul 13 22:31:23 2008 +0200) 6 commits
- Allowadd_path()to add non-existent directories to the path
- Allow the built-in exec path to be relative to the command invocation path
- Fix relative built-in paths to be relative to the command invocation
+ help (Windows): Display HTML in default browser using Windows' shell API
+help.c: Add support for htmldir relative togit_exec_path()
+ Move code interpreting path relative to exec-dir to new functionsystem_path()
Quoted 2 lines
The earlier parts are obvious; Dscho seemed to have some comments on the later ones that are in 'pu'.
Just one, and it seems that the next patch patched that ;-) Not really a showstopper.
Quoted 2 lines
* mv/merge-in-c (Sun Jul 13 08:13:55 2008 +0000) 19 commits
+reduce_heads(): thinkofix
Hmm. My earlier response to Sverre was based on an old "next", it seems.
Ciao,
Dscho
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
The topics list the commits in reverse chronological order. The topics meant to be merged to the maintenance series have "maint-" in their names.
It so happens that the topics clearly separated between the ones that are obviously ready for 1.6.0 and the others that aren't yet as of tonight. It seems that it is a good time to draw that line and tag -rc0 tomorrow, after merging the remaining topics in 'next'.
----------------------------------------------------------------
[New Topics]
I could apply these directly to master, but I am just playing it safe.
* sp/maint-index-pack (Tue Jul 15 04:45:34 2008 +0000) 4 commits
+ index-pack: Honor core.deltaBaseCacheLimit when resolving deltas
+ index-pack: Track the object_entry that creates each base_data
+ index-pack: Chain the struct base_data on the stack for traversal
+ index-pack: Refactor base arguments of resolve_delta into a struct
* rs/rebase-checkout-not-so-quiet (Mon Jul 14 14:05:35 2008 -0700) 1 commit
+ git-rebase: report checkout failure
* ag/blame (Wed Jul 16 02:00:58 2008 +0400) 2 commits
+ Do not try to detect move/copy for entries below threshold.
+ Avoid rescanning unchanged entries in search for copies.
This gives a drastic performance improvement to "git-blame -C -C" with quite straightforward and obvious code change.
* rs/archive (Mon Jul 14 21:22:05 2008 +0200) 6 commits
+ archive: remove extra arguments parsing code
+ archive: unify file attribute handling
+ archive: centralize archive entry writing
+ archive: add baselen member to struct archiver_args
+ add context pointer to read_tree_recursive()
+ archive: remove args member from struct archiver
----------------------------------------------------------------
[Will merge to master soon]
* sb/dashless (Sun Jul 13 15:36:15 2008 +0200) 3 commits
+ Make usage strings dash-less
+ t/: Use "test_must_fail git" instead of "! git"
+ t/test-lib.sh: exit with small negagive int is ok with test_must_fail
* mv/dashless (Fri Jul 11 02:12:06 2008 +0200) 4 commits
+ make remove-dashes: apply to scripts and programs as well, not just to builtins
+ git-bisect: use dash-less form on git bisect log
+ t1007-hash-object.sh: use quotes for the test description
+ t0001-init.sh: change confusing directory name
* ls/mailinfo (Sun Jul 13 20:30:12 2008 +0200) 3 commits
+ git-mailinfo: use strbuf's instead of fixed buffers
+ Add some useful functions for strbuf manipulation.
+ Make some strbuf_*() struct strbuf arguments const.
----------------------------------------------------------------
[Graduated to "master"]
* sp/maint-bash-completion-optim (Mon Jul 14 00:22:03 2008 +0000) 1 commit
+ bash completion: Append space after file names have been completed
Early parts were already merged to 'master' and need to be merged down to maint as well, as this is about a "performance bug" that has been with us almost forever.
* ag/rewrite_one (Sat Jul 12 22:00:57 2008 +0400) 1 commit
+ Fix quadratic performance in rewrite_one.
* sp/win (Fri Jul 11 18:52:42 2008 +0200) 3 commits
+ We need to check for msys as well as Windows in add--interactive.
+ Convert CR/LF to LF in tag signatures
+ Fixed text file auto-detection: treat EOF character 032 at the end of file as printable
* js/merge-rr (Sat Jul 12 15:56:19 2008 +0100) 2 commits
+ Move MERGE_RR from .git/rr-cache/ into .git/
+ builtin-rerere: more carefully find conflict markers
* sb/rerere-lib (Wed Jul 9 14:58:57 2008 +0200) 2 commits
+ rerere: Separate libgit and builtin functions
+ builtin-rerere: more carefully find conflict markers
* js/maint-pretty-mailmap (Sat Jul 12 00:28:18 2008 +0100) 1 commit
+ Add pretty format %aN which gives the author name, respecting .mailmap
* js/more-win (Sun Jul 13 22:31:23 2008 +0200) 3 commits
+ help (Windows): Display HTML in default browser using Windows' shell API
+ help.c: Add support for htmldir relative to git_exec_path()
+ Move code interpreting path relative to exec-dir to new function system_path()
* jc/rebase-orig-head (Tue Jul 8 00:12:22 2008 -0400) 2 commits
+ Documentation: mention ORIG_HEAD in am, merge, and rebase
+ Teach "am" and "rebase" to mark the original position with ORIG_HEAD
* jc/branch-merged (Tue Jul 8 17:55:47 2008 -0700) 3 commits
+ branch --merged/--no-merged: allow specifying arbitrary commit
+ branch --contains: default to HEAD
+ parse-options: add PARSE_OPT_LASTARG_DEFAULT flag
* om/rerere-careful (Mon Jul 7 14:42:48 2008 +0200) 1 commit
+ builtin-rerere: more carefully find conflict markers
* ls/maint-mailinfo-patch-label (Thu Jul 10 23:41:33 2008 +0200) 1 commit
+ git-mailinfo: Fix getting the subject from the in-body [PATCH] line
* mv/merge-in-c (Mon Jul 14 00:09:41 2008 -0700) 20 commits
+ reduce_heads(): protect from duplicate input
+ reduce_heads(): thinkofix
+ Add a new test for git-merge-resolve
+ t6021: add a new test for git-merge-resolve
+ Teach merge.log to "git-merge" again
+ Build in merge
+ Fix t7601-merge-pull-config.sh on AIX
+ git-commit-tree: make it usable from other builtins
+ Add new test case to ensure git-merge prepends the custom merge message
+ Add new test case to ensure git-merge reduces octopus parents when possible
+ Introduce reduce_heads()
+ Introduce get_merge_bases_many()
+ Add new test to ensure git-merge handles more than 25 refs.
+ Introduce get_octopus_merge_bases() in commit.c
+ git-fmt-merge-msg: make it usable from other builtins
+ Move read_cache_unmerged() to read-cache.c
+ Add new test to ensure git-merge handles pull.twohead and pull.octopus
+ Move parse-options's skip_prefix() to git-compat-util.h
+ Move commit_list_count() to commit.c
+ Move split_cmdline() to alias.c
----------------------------------------------------------------
[On Hold]
* rs/imap (Wed Jul 9 22:29:02 2008 +0100) 5 commits
- Documentation: Improve documentation for git-imap-send(1)
- imap-send.c: more style fixes
- imap-send.c: style fixes
- git-imap-send: Support SSL
- git-imap-send: Allow the program to be run from subdirectories of a git tree
Some people seem to prefer having this feature available also with gnutls. If such a patch materializes soon, that would be good, but otherwise I'll merge this as-is to 'next'. Such an enhancement can be done in-tree on top of this series.
* xx/merge-in-c-into-next (Wed Jul 9 13:51:46 2008 -0700) 4 commits
+ Teach git-merge -X<option> again.
+ Merge branch 'jc/merge-theirs' into xx/merge-in-c-into-next
+ builtin-merge.c: use parse_options_step() "incremental parsing" machinery
+ Merge branch 'ph/parseopt-step-blame' into xx/merge-in-c-into-next
This needs to be merged to master iff/when merge-theirs gets merged, but I do not think this series is widely supported, so both are on hold.
* jc/merge-theirs (Mon Jun 30 22:18:57 2008 -0700) 5 commits
+ Make "subtree" part more orthogonal to the rest of merge- recursive.
+ Teach git-pull to pass -X<option> to git-merge
+ Teach git-merge to pass -X<option> to the backend strategy module
+ git-merge-recursive-{ours,theirs}
+ git-merge-file --ours, --theirs
Punting a merge by discarding your own work in conflicting parts but still salvaging the parts that are cleanly automerged. It is likely that this will result in nonsense mishmash, but somehow often people want this, so here they are. The interface to the backends is updated so that you can say "git merge -Xours -Xsubtree=foo/bar/baz -s recursive other" now.
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config variables
This was previously in "will be in master soon" category, but it turns out that the synonyms to the ones this one deletes are fairly new invention that happend in 1.5.6 timeframe, and we cannot do this just yet. Perhaps in 1.7.0.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0 timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly asked for
This would be the right thing to do for command line use, but gitk will be hit due to tcl/tk's limitation, so I am holding this back for now.
----------------------------------------------------------------
[Stalled/Needs more work]
* gi/cherry-cache (Sat Jul 12 20:14:51 2008 -0700) 1 commit . cherry: cache patch-ids to avoid repeating work
* lw/gitweb (Fri Jul 11 03:11:48 2008 +0200) 3 commits . gitweb: use new Git::Repo API, and add optional caching . Add new Git::Repo API
. gitweb: add test suite with Test::WWW::Mechanize::CGI
* sb/sequencer (Tue Jul 1 04:38:34 2008 +0200) 4 commits . Migrate git-am to use git-sequencer
. Add git-sequencer test suite (t3350)
. Add git-sequencer prototype documentation
. Add git-sequencer shell prototype
* jc/grafts (Wed Jul 2 17:14:12 2008 -0700) 1 commit
- [BROKEN wrt shallow clones] Ignore graft during object transfer
Cloning or fetching from a repository from grafts did not send objects that are hidden by grafts, but the commits in the resulting repository do need these to pass fsck. This fixes object transfer to ignore grafts.
Another fix is needed to git-prune so that it ignores grafts but treats commits that are mentioned in grafts as reachable.
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 2 commits
- blame: show "previous" information in --porcelain/--incremental format
- git-blame: refactor code to emit "porcelain format" output
This is for peeling to see what's behind the blamed commit, which may or may not help applications like gitweb.
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
The topics list the commits in reverse chronological order. The topics meant to be merged to the maintenance series have "maint-" in their names.
Right now 'next' is very thin. After today's new topics, perhaps except for the submodule stuff by Pasky, are merged to 'master', we will have the 1.6.0-rc0, and from there the usual pre-release freeze begins.
Due to increased activity level from people including GSoC students, I expect 'next' to stay somewhat more active than previous rounds during the 1.6.0-rc cycle. The request for people who usually follow 'next' is the same as usual, though. After -rc1 is tagged, please run 'master' for your daily git use instead, in order to make sure 'master' does what it claims to do without regression.
Tentative schedule, my wishful thinking:
- 1.6.0-rc0 (Jul 20)
- 1.6.0-rc1 (Jul 23)
- 1.6.0-rc2 (Jul 30)
- 1.6.0-rc3 (Aug 6)
- 1.6.0 (Aug 10)
----------------------------------------------------------------
[New Topics]
* jc/rerere-auto-more (Wed Jul 16 20:25:18 2008 -0700) 1 commit
- rerere.autoupdate: change the message when autoupdate is in effect
This one is for Ingo.
This changes the message rerere issues after reusing previous conflict resolution from "Resolved" to "Staged" when autoupdate option is in effect.
It is envisioned that in practice, some auto resolutions are trickier and iffier than others, and we would want to add a feature to mark individual resolutions as "this is ok to autoupdate" or "do not autoupdate the result using this resolution even when rerere.autoupdate is in effect" in the future. When that happens, these messages will make the distinction clearer.
* ap/trackinfo (Wed Jul 16 15:19:27 2008 -0400) 1 commit
- Reword "your branch has diverged..." lines to reduce line length
You saw the exchange on the list. Queued is my "make it shorter and make sure variable parts are closer to left edge of the screen" version but better alternatives are welcome. I suspect not many people would care too much about details, as long as the message fits and does not waste screen real estate.
* ns/am-abort (Wed Jul 16 19:39:10 2008 +0900) 1 commit
- git am --abort
This one is for Ted; builds on top of the recent "am and rebase leaves ORIG_HEAD just like reset, merge and pull does" rather nicely.
* pb/submodule (Wed Jul 16 21:11:40 2008 +0200) 7 commits
- t7403: Submodule git mv, git rm testsuite
- git rm: Support for removing submodules
- git mv: Support moving submodules
- submodule.*: Introduce simple C interface for submodule lookup by path
- git submodule add: Fix naming clash handling
- t7400: Add short "git submodule add" testsuite
- git-mv: Remove dead code branch
Long overdue usability improvement series for submodule. Very much welcomed. It would be nice to have some submodule improvements in 1.6.0. Realistically speaking, however, I predict that it would take us a few more rounds to hit 'next' with this, and it will not be in 'master' when 1.6.0 ships.
----------------------------------------------------------------
[Graduated to "master"]
* sp/maint-index-pack (Tue Jul 15 04:45:34 2008 +0000) 4 commits
+ index-pack: Honor core.deltaBaseCacheLimit when resolving deltas
+ index-pack: Track the object_entry that creates each base_data
+ index-pack: Chain the struct base_data on the stack for traversal
+ index-pack: Refactor base arguments of resolve_delta into a struct
* rs/rebase-checkout-not-so-quiet (Mon Jul 14 14:05:35 2008 -0700) 1 commit
+ git-rebase: report checkout failure
* ag/blame (Wed Jul 16 02:00:58 2008 +0400) 2 commits
+ Do not try to detect move/copy for entries below threshold.
+ Avoid rescanning unchanged entries in search for copies.
This gives a drastic performance improvement to "git-blame -C -C" with quite straightforward and obvious code change.
* rs/archive (Mon Jul 14 21:22:05 2008 +0200) 6 commits
+ archive: remove extra arguments parsing code
+ archive: unify file attribute handling
+ archive: centralize archive entry writing
+ archive: add baselen member to struct archiver_args
+ add context pointer to read_tree_recursive()
+ archive: remove args member from struct archiver
* sb/dashless (Sun Jul 13 15:36:15 2008 +0200) 3 commits
+ Make usage strings dash-less
+ t/: Use "test_must_fail git" instead of "! git"
+ t/test-lib.sh: exit with small negagive int is ok with test_must_fail
* mv/dashless (Fri Jul 11 02:12:06 2008 +0200) 4 commits
+ make remove-dashes: apply to scripts and programs as well, not just to builtins
+ git-bisect: use dash-less form on git bisect log
+ t1007-hash-object.sh: use quotes for the test description
+ t0001-init.sh: change confusing directory name
* ls/mailinfo (Sun Jul 13 20:30:12 2008 +0200) 3 commits
+ git-mailinfo: use strbuf's instead of fixed buffers
+ Add some useful functions for strbuf manipulation.
+ Make some strbuf_*() struct strbuf arguments const.
This actually had a tiny regression I did not discover until I merged it to 'master', where a fixup has already been applied.
----------------------------------------------------------------
[On Hold]
* rs/imap (Wed Jul 9 22:29:02 2008 +0100) 5 commits
- Documentation: Improve documentation for git-imap-send(1)
- imap-send.c: more style fixes
- imap-send.c: style fixes
- git-imap-send: Support SSL
- git-imap-send: Allow the program to be run from subdirectories of a git tree
I said: "Some people seem to prefer having this feature available also with gnutls. If such a patch materializes soon, that would be good, but otherwise I'll merge this as-is to 'next'. Such an enhancement can be done in-tree on top of this series." Anybody?
* xx/merge-in-c-into-next (Wed Jul 9 13:51:46 2008 -0700) 4 commits
+ Teach git-merge -X<option> again.
+ Merge branch 'jc/merge-theirs' into xx/merge-in-c-into-next
+ builtin-merge.c: use parse_options_step() "incremental parsing" machinery
+ Merge branch 'ph/parseopt-step-blame' into xx/merge-in-c-into-next
This needs to be merged to master iff/when merge-theirs gets merged, but I do not think this series is widely supported, so both are on hold.
* jc/merge-theirs (Mon Jun 30 22:18:57 2008 -0700) 5 commits
+ Make "subtree" part more orthogonal to the rest of merge- recursive.
+ Teach git-pull to pass -X<option> to git-merge
+ Teach git-merge to pass -X<option> to the backend strategy module
+ git-merge-recursive-{ours,theirs}
+ git-merge-file --ours, --theirs
Punting a merge by discarding your own work in conflicting parts but still salvaging the parts that are cleanly automerged. It is likely that this will result in nonsense mishmash, but somehow often people want this, so here they are. The interface to the backends is updated so that you can say "git merge -Xours -Xsubtree=foo/bar/baz -s recursive other" now.
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config variables
This was previously in "will be in master soon" category, but it turns out that the synonyms to the ones this one deletes are fairly new invention that happend in 1.5.6 timeframe, and we cannot do this just yet. Perhaps in 1.7.0.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0 timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly asked for
This would be the right thing to do for command line use, but gitk will be hit due to tcl/tk's limitation, so I am holding this back for now.
----------------------------------------------------------------
[Stalled/Needs more work]
* gi/cherry-cache (Sat Jul 12 20:14:51 2008 -0700) 1 commit . cherry: cache patch-ids to avoid repeating work
The discussion suggested that the value of having the cache itself is iffy, but I should pick up the updated one and look at it.
* lw/gitweb (Fri Jul 11 03:11:48 2008 +0200) 3 commits . gitweb: use new Git::Repo API, and add optional caching . Add new Git::Repo API
. gitweb: add test suite with Test::WWW::Mechanize::CGI
* sb/sequencer (Tue Jul 1 04:38:34 2008 +0200) 4 commits . Migrate git-am to use git-sequencer
. Add git-sequencer test suite (t3350)
. Add git-sequencer prototype documentation
. Add git-sequencer shell prototype
I haven't looked at the updated series yet. I should, but nobody else seems to be looking at these patches, which is somewhat depressing but understandable. Summer is slower ;-)
* jc/grafts (Wed Jul 2 17:14:12 2008 -0700) 1 commit
- [BROKEN wrt shallow clones] Ignore graft during object transfer
Cloning or fetching from a repository from grafts did not send objects that are hidden by grafts, but the commits in the resulting repository do need these to pass fsck. This fixes object transfer to ignore grafts.
Another fix is needed to git-prune so that it ignores grafts but treats commits that are mentioned in grafts as reachable.
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 2 commits
- blame: show "previous" information in --porcelain/--incremental format
- git-blame: refactor code to emit "porcelain format" output
This is for peeling the line from the blamed version to see what's behind it, which may or may not help applications like gitweb.
Hi,
Quoted 9 lines · Junio C Hamano
* sb/sequencer (Tue Jul 1 04:38:34 2008 +0200) 4 commits . Migrate git-am to use git-sequencer
. Add git-sequencer test suite (t3350)
. Add git-sequencer prototype documentation
. Add git-sequencer shell prototypeI haven't looked at the updated series yet. I should, but nobody else seems to be looking at these patches, which is somewhat depressing but understandable. Summer is slower ;-)
imho there is no need to hurry, but if I can help, just tell me how.
Regards.
Signature · 1 line
Stephan Beyer <[email protected]>, PGP 0x6EDDD207FCC5040F
Quoting Junio C Hamano <[email protected]>:
Quoted 9 lines
* xx/merge-in-c-into-next (Wed Jul 9 13:51:46 2008 -0700) 4 commits
+ Teach git-merge -X<option> again.
+ Merge branch 'jc/merge-theirs' into xx/merge-in-c-into-next
+builtin-merge.c: useparse_options_step()"incremental parsing" machinery
+ Merge branch 'ph/parseopt-step-blame' into xx/merge-in-c-into-nextThis needs to be merged to master iff/when merge-theirs gets merged, but I do not think this series is widely supported, so both are on hold.
Why do you say it is not widely supported? I may be wrong but I think you developed these patches after somebody from the mailing list asked for this feature.
You may find out people are enthusiastic about this only after you merge it to your master branch.
Signature · 2 lines
Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/
Quoted 9 lines · Nanako Shiraishi
Quoting Junio C Hamano <[email protected]>:
Quoted 7 lines
* xx/merge-in-c-into-next (Wed Jul 9 13:51:46 2008 -0700) 4 commits
+ Teach git-merge -X<option> again.
+ Merge branch 'jc/merge-theirs' into xx/merge-in-c-into-next
+builtin-merge.c: useparse_options_step()"incremental parsing" machinery
+ Merge branch 'ph/parseopt-step-blame' into xx/merge-in-c-into-next
Quoted 6 lines
Quoted 2 lines
This needs to be merged to master iff/when merge-theirs gets merged, but I do not think this series is widely supported, so both are on hold.
Why do you say it is not widely supported? I may be wrong but I think you developed these patches after somebody from the mailing list asked for this feature.
Well, for one thing, I do not believe in their cause. As I wrote in the log messages for these commits (actually not these above which is a series for merge fixup, but the other topic), I do not think it is a sensible thing to say "let's take as much automerge results as possible to salvage our changes where they do not overlap with what the upstream did, but I would give up our changes to places that the upstream also touched, because I do not understand what they did well enough to be able to resolve the merge conflicts correctly", and "merge -Xtheirs" is exactly that.
That also was the reason I did not add any documentation to it. But I do like the change to the infrastructure to allow passing strategy-specific options through git-merge and git-pull. Perhaps I should write something up, if only to salvage that -X<option> part, even though I am very much inclined to discard -Xtheirs (and -Xours) part.
Quoting Junio C Hamano <[email protected]>:
Quoted 9 lines
Well, for one thing, I do not believe in their cause. As I wrote in the log messages for these commits (actually not these above which is a series for merge fixup, but the other topic), I do not think it is a sensible thing to say "let's take as much automerge results as possible to salvage our changes where they do not overlap with what the upstream did, but I would give up our changes to places that the upstream also touched, because I do not understand what they did well enough to be able to resolve the merge conflicts correctly", and "merge -Xtheirs" is exactly that.
I do not know if "I do not understand what they did well enough" is the only reason people would want to use that feature. Isn't it better to let people decide that for themselves?
Quoted 5 lines
That also was the reason I did not add any documentation to it. But I do like the change to the infrastructure to allow passing strategy-specific options through git-merge and git-pull. Perhaps I should write something up, if only to salvage that -X<option> part, even though I am very much inclined to discard -Xtheirs (and -Xours) part.
I think such a documentation will help people to decide if 'theirs' option makes sense for their workflow.
Signature · 2 lines
Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/
Quoted 1 line · Nanako Shiraishi
I do not know if "I do not understand what they did well enough" is the only reason people would want to use that feature. Isn't it better to let people decide that for themselves?
It is dangerous to introduce new options just because we think someone, sometimes might find it useful, especially if they potentially encourage a bad workflow. Adding options and commands is expensive since it complicates the UI further, thus we should add further only when we have good reason for it.
Quoted 1 line
Quoted 1 line
That also was the reason I did not add any documentation to it.
I was actually looking for something like this based on some question on #git (about git pull -s theirs possibility), and did stumble upon these patches, but quickly gave up on them since it wasn't immediately clear for me from the patch description exactly how the workflow looks like (it doesn't really seem to work like the opposite of -s ours nor is it a separate strategy... huh) and the options were completely undocumented.
Signature · 4 lines
Petr "Pasky" Baudis GNU, n. An animal of South Africa, which in its domesticated state resembles a horse, a buffalo and a stag. In its wild condition it is something like a thunderbolt, an earthquake and a cyclone. -- A. Pierce
Quoted 9 lines · Petr Baudis
Quoted 1 line · Nanako Shiraishi
I do not know if "I do not understand what they did well enough" is the only reason people would want to use that feature. Isn't it better to let people decide that for themselves?
It is dangerous to introduce new options just because we think someone, sometimes might find it useful, especially if they potentially encourage a bad workflow. Adding options and commands is expensive since it complicates the UI further, thus we should add further only when we have good reason for it.
Quoted 8 lines
Quoted 1 line
Quoted 1 line
That also was the reason I did not add any documentation to it.
I was actually looking for something like this based on some question on #git (about git pull -s theirs possibility), and did stumble upon these patches, but quickly gave up on them since it wasn't immediately clear for me from the patch description exactly how the workflow looks like (it doesn't really seem to work like the opposite of -s ours nor is it a separate strategy... huh) and the options were completely undocumented.
Heh, now you have some readings to do ;-)
I tried not to sound too negative when describing -Xours and -Xtheirs there, but actually I think "-s theirs" is even worse. It is how you would discard what you did (perhaps because the other side has much better solution than your hack), but that can be much more easily and cleanly done with:
$ git reset --hard origin
Some poeple might say "But with 'merge -s theirs', I can keep what I did, too". That reset is simply discarding what I did.
That logic also is flawed. You can instead:
$ git branch i-was-stupid
$ git reset --hard originif you really want to keep record of your failure.
One big problem "-s theirs" has, compared to the above "reset to origin, discarding or setting aside the failed history" is that your 'master' history that your further development is based on will keep your failed crap in it forever if you did "-s theirs". Hopefully you will become a better programmer over time, and you may eventually have something worth sharing with the world near the tip of your master branch. When that happens, however, you _cannot_ offer your master branch to be pulled by the upstream, as the wider world will not be interested in your earlier mistakes at all.
Quoting Junio C Hamano <[email protected]>:
Quoted 18 lines
I tried not to sound too negative when describing -Xours and -Xtheirs there, but actually I think "-s theirs" is even worse. It is how you would discard what you did (perhaps because the other side has much better solution than your hack), but that can be much more easily and cleanly done with:
$ git reset --hard originSome poeple might say "But with 'merge -s theirs', I can keep what I did, too". That reset is simply discarding what I did.
That logic also is flawed. You can instead:
$ git branch i-was-stupid $ git reset --hard originif you really want to keep record of your failure.
Quoted 9 lines
One big problem "-s theirs" has, compared to the above "reset to origin, discarding or setting aside the failed history" is that your 'master' history that your further development is based on will keep your failed crap in it forever if you did "-s theirs". Hopefully you will become a better programmer over time, and you may eventually have something worth sharing with the world near the tip of your master branch. When that happens, however, you _cannot_ offer your master branch to be pulled by the upstream, as the wider world will not be interested in your earlier mistakes at all.
Thanks for sharing your insight. Perhaps the above can become a separate pargraph to explains why there is no "theirs" merge strategy somewhere in the manual?
Signature · 2 lines
Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/
Dear Everyone,
Quoted 4 lines
I tried not to sound too negative when describing -Xours and -Xtheirs there, but actually I think "-s theirs" is even worse. It is how you would discard what you did (perhaps because the other side has much better solution than your hack)
or perhaps this is very well intended, e.g. if you are tracking other project's development and just need to carry a limited portion of the source tree.
Sorry for reincarnating this old thread, but since I have filed Debian wishlist bug against GIT for '-s theirs':
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581680
and this thread is linked to it as the ultimate source 'why not (yet)', I want to describe a usecase when/why I wanted to have -s theirs:
For debian packaging, we often need to clean up the upstream source tree so it does not contain non-free material (binary blobs, components under non-free licenses, etc). If I want to setup all packaging within GIT, I would follow natively following setup:
git checkout -b dfsg 0.1
git rm non-free-1 non-free-2 ...
git commit -m "DFSG-compliant 0.1"
git tag -a -m 0.1.dfsg
and base my packaging off dfsg branch (in a separate branch, e.g. debian).
Upon release 0.2 of upstream work, in the simplest case, I can do now
git checkout dfsg
git merge 0.2
and there things could get hairy -- if files were modified upstream, I get conflicts, so I would need to git rm files again, and only then commit the merge:
git rm
Moreover, 0.2 might not follow 0.1 -- upstream might release off "release-branches", then I simply *must not* do "git merge" with recursive strategy.
Moreover, if some material finally became free, I would need to re-add it somehow into dfsg branch from 0.2 branch.
*All* those complications could easily be avoided if I only had '-s theirs'. Then I simply
git checkout dfsg
git merge --no-commit -s theirs 0.2
# after all I do not, and must not have my modifications git rm -rf non-free-1 ... # probably would be scripted git commit
With -s theirs now I would be able manage all tricky cases above without hassle in a unified way.
Would it be possible to have GIT people reconsider addition of '-s theirs'?
Thank you in advance for your time!
Quoted 5 lines · Yaroslav Halchenko
git checkout dfsg
git merge --no-commit -s theirs 0.2# after all I do not, and must not have my modifications git rm -rf non-free-1 ... # probably would be scripted git commit
The other day I was talking with Shawn Pearce and said that "-s theirs" would make sense only if used with --no-commit.
But for such a use case, "git read-tree -m -u 0.2" would work just as well, and discussion ended there ;-)
Quoted 4 lines · Junio C Hamano
would make sense only if used with --no-commit.
But for such a use case, "git read-tree -m -u 0.2" would work just as well, and discussion ended there ;-)
hm -- read-tree sounded like yet another unknown to me feature of GIT I was trying desperately to discover ;) unfortunately it doesn't produce a merge for me :-/ -- just a simple commit with the state taken from the other tree:
$> git read-tree -m -u origin/master
cached/staged changes: 179 changes
$> git commit -m 'blunt merge for -s theirs: -m -u origin/master ' [maint/0.5 b246251] blunt merge for -s theirs: -m -u origin/master
175 files changed, 9589 insertions(+), 4914 deletions(-) create mode 100644 doc/pics/ex_curvefitting_bold.svg create mode 100644 doc/pics/ex_curvefitting_searchlight.svg
...
$> git show HEAD^2
fatal: ambiguous argument 'HEAD^2': unknown revision or path not in the working tree.
I am using git (Debian amd64): 1:1.7.2.3-2.1 (so it is 1.7.2.3)
Signature · 5 lines
Yaroslav O. Halchenko Postdoctoral Fellow, Department of Psychological and Brain Sciences Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755 Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419 WWW: http://www.linkedin.com/in/yarik
Am 12/13/2010 22:46, schrieb Yaroslav Halchenko:
Quoted 7 lines · Junio C Hamano
Quoted 2 lines
But for such a use case, "git read-tree -m -u 0.2" would work just as well, and discussion ended there ;-)
hm -- read-tree sounded like yet another unknown to me feature of GIT I was trying desperately to discover ;) unfortunately it doesn't produce a merge for me :-/ -- just a simple commit with the state taken from the other tree:
How about:
git merge --no-commit -s ours 0.2 git read-tree -m -u 0.2 git commit -m "Reset to 0.2"
-- Hannes
Quoted 7 lines · Johannes Sixt
Quoted 3 lines
hm -- read-tree sounded like yet another unknown to me feature of GIT I was trying desperately to discover ;) unfortunately it doesn't produce a merge for me :-/ -- just a simple commit with the state taken from the other tree:
How about:
git merge --no-commit -s ours 0.2
git read-tree -m -u 0.2
git commit -m "Reset to 0.2"
Thank you Johannes for chewing it up to ease the digestion by my brainless stomach -- works just fine ;)
I guess this could be the alias for my needs:
mtheirs = !sh -c 'git merge -s ours --no-commit $1 && git read-tree -m -u "$1"' -
but since it might be a generic pattern for the use case(s) I have stated I still see no objective reason why simple '-s theirs' should not be there.
Signature · 3 lines
=------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic
Quoted 9 lines · Yaroslav Halchenko
Quoted 4 lines · Junio C Hamano
would make sense only if used with --no-commit.
But for such a use case, "git read-tree -m -u 0.2" would work just as well, and discussion ended there ;-)
hm -- read-tree sounded like yet another unknown to me feature of GIT I was trying desperately to discover ;) unfortunately it doesn't produce a merge for me
Didn't I already say it makes sense only with --no-commit? IOW to shape the tree.
And in your use case I do not think you would even want to have a merge. Even if you run "git rm" to remove non-free stuff from the merge result, if you merged the history of 0.2 that contains non-free stuff you are not allowed to distribute (forbidden either by upstream or self-imposed dfsg, the reason does not matter), people who gets the merge commit can follow its second parent to grab the non-free stuff, no?
Quoted 6 lines · Junio C Hamano
Quoted 3 lines
hm -- read-tree sounded like yet another unknown to me feature of GIT I was trying desperately to discover ;) unfortunately it doesn't produce a merge for me
Didn't I already say it makes sense only with --no-commit? IOW to shape the tree.
rright -- in my case --no-commit so I could remove the content before committing.
Quoted 6 lines
And in your use case I do not think you would even want to have a merge. Even if you run "git rm" to remove non-free stuff from the merge result, if you merged the history of 0.2 that contains non-free stuff you are not allowed to distribute (forbidden either by upstream or self-imposed dfsg, the reason does not matter), people who gets the merge commit can follow its second parent to grab the non-free stuff, no?
I see your point better now -- so it is yet another dimension of "the feature".
as for non-free -- I probably should have been more precise -- non-DFSG (debian free software guidelines)-free ;) i.e.:
* free compiled,rendered materials, often binary blobs, without sources (e.g. .dll's, pdfs etc)
* material under free but not DFSG-free licenses, etc
* if upstream repository already provides that 'non-free' material it would not be much of my misdemeanor to keep them as well buried in the repository history. What I care is to have a cleaned branch from which I could git archive, and also which I could inspect in regards to changes between releases without visually filtering all changes in non-sources (e.g. those binary blobs) or irrelevant content.
if ever legal situation causes upstream to rewrite history to remove them -- I will have to do that as well anyways :-/
Having an actual merge would be useful for making the explicit "bridge" from upstream branch, thus '--no-commit -s theirs' with consecutive cleaning before commit looks the way to go IMHO. But I see now that I could possibly use read-tree at times if a real necessity comes to prune non-distributable content, and then obviously I do not want to drag upstream's illegal stuff along.
Signature · 5 lines
Yaroslav O. Halchenko Postdoctoral Fellow, Department of Psychological and Brain Sciences Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755 Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419 WWW: http://www.linkedin.com/in/yarik
Quoted 10 lines · Nanako Shiraishi
Quoting Junio C Hamano <[email protected]>:
Quoted 7 lines
... I do not think it is a sensible
thing to say "let's take as much automerge results as possible to salvage our changes where they do not overlap with what the upstream did, but I would give up our changes to places that the upstream also touched, because I do not understand what they did well enough to be able to resolve the merge conflicts correctly", and "merge -Xtheirs" is exactly that.
Quoted 3 lines
I do not know if "I do not understand what they did well enough" is the only reason people would want to use that feature. Isn't it better to let people decide that for themselves?
We have been saying that we will give long enough rope to people, but at the same time I believe there are things that the world is better without, and a feature that would only encourage a bad workflow is one of them. The way I try to tell such a (mis)feature from a feature that can be useful to people other than myself is to ask people why they would want such a feature and what their response to possible downsides of such a feature.
Don't get me wrong. Choice is good, and it is also good that some people may choose differently from me. After all, we are different people with different workflows.
But they should be able to explain the reason why they choose something clearly, at least well enough to convince themselves to choose it. If they can't come up with a rational explanation, it becomes an irrational "because I want to" (and "because I can, now that you have already coded it"). That leads to feeping creaturism and a bad feature that the world is better without.
I haven't heard an explanation other than the one I said above, and I do not think that explanation is rational.
Side note. Even though I invented rerere and it turned out to be a great ti[mp]esaver, I do want to validate the reused resolution makes sense in the new context every time rerere does its job. Recently Ingo wanted the auto resolution to be staged automatically, and rerere.autoupdate was born. I was initially very much against it, but his description of the workflow where it would be useful was convincing enough. This "convincing" does not have to be "Yeah, it's useful to me as well; thanks for explaining it to me". Even though my workflow might never be helped with such a feature, I can see that the different workflow he presented would be useful to people other than myself, and I could agree that the new feature would help such a workflow. This was a good example of "choosing something I initially thought would be detrimental with a good reason, and with a good explanation making me realize that my initial thought was too narrow".
Quoted 2 lines
I think such a documentation will help people to decide if 'theirs' option makes sense for their workflow.
So here it is.
-- >8 --
[PATCH] Document that merge strategies can now take their own options
Also document the recently added -Xtheirs, -Xours and -Xsubtree[=path] options to the merge-recursive strategy.
--- Documentation/merge-options.txt | 4 ++++ Documentation/merge-strategies.txt | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 0 deletions(-)
Documentation/merge-options.txt +4 -0
@@ -58,3 +58,7 @@ If there is no `-s` option, a built-in list of strategies is used instead (`git-merge-recursive` when merging a single head, `git-merge-octopus` otherwise). + +-X<option>:: + Pass merge strategy specific option through to the merge + strategy.
Documentation/merge-strategies.txt +26 -0
@@ -1,6 +1,11 @@ MERGE STRATEGIES ---------------- +The merge mechanism ('git-merge' and 'git-pull' commands) allows the +backend 'merge strategies' to be chosen with `-s` option. Some strategies +can also take their own options, which can be passed by giving `-X<option>` +arguments to 'git-merge' and/or 'git-pull'. + resolve:: This can only resolve two heads (i.e. the current branch and another branch you pulled from) using 3-way merge
@@ -20,6 +25,27 @@ recursive:: Additionally this can detect and handle merges involving renames. This is the default merge strategy when pulling or merging one branch. ++ +The 'recursive' strategy can take the following options: + +ours;; + This option forces conflicting hunks to be auto-resolved cleanly by + favoring 'our' version. Changes from the other tree that do not + conflict with our side are reflected to the merge result. ++ +This should not be confused with the 'ours' merge strategy, which does not +even look at what the other tree contains at all. IOW, it discards everything +the other tree did, declaring 'our' history contains all that happened in it. + +theirs;; + This is opposite of 'ours'. + +subtree[=path];; + This option is a more advanced form of 'subtree' strategy, where + the strategy makes a guess on how two trees must be shifted to + match with each other when merging. Instead, the specified path + is prefixed (or stripped from the beginning) to make the shape of + two trees to match. octopus:: This resolves more than two-head case, but refuses to do
Signature · 1 line
1.5.6.3.573.gd2d2
Hi,
Documentation/merge-strategies.txt recursive:: · line 31
Quoted 3 lines · Junio C Hamano
Documentation/merge-strategies.txt +3
-0+The 'recursive' strategy can take the following options: + +ours;;
You still have not addressed the issue that you can specify multiple strategies, or even a single _wrong_ one. So:
$ git merge -s stupid -Xours
would not fail at all, but definitely not do the right thing either (it disobeys a direct command of the user).
Apart from having to choose different -X option names for the different backends, to avoid them from clashing when you specify multiple strategies, you also deprive the user from being able to try the _same_ backend with different options.
IOW all my objections to the -X option (even that it does not fit with our short option parsing paradigm) still apply.
We already have the "-S" wart, let's not add to that pile.
Ciao,
Dscho
Quoted 8 lines · Johannes Schindelin
Documentation/merge-strategies.txt recursive:: · line 31
Quoted 3 lines · Junio C Hamano
Documentation/merge-strategies.txt +3
-0+The 'recursive' strategy can take the following options: + +ours;;You still have not addressed the issue that you can specify multiple strategies,...
Even though multiple -s parameters are supported, I know you have been here long enough in git scene to remember how it came about. I've seen some third-party documents that talk about our ability to "try multiple strategies and pick the best one" as one of the unique features, but anybody who was there knows that it was just a failed experiment that we did not bother removing.
The thing is, trying multiple strategies was a cute idea and it was quite straightforward to implement. But picking the best one is the much more important part, and judging whose result is the best shouldn't be done with just a naïve "how many conflicting paths remain there?" metric (c.f. $gmane/87297 which talks about "stupid" but the argument is exactly the same --- smaller number of conflicts may not necessarily be the easiest to resolve nor the right resolution). I would be surprised if anybody uses multiple -s options in their daily workflow, even though I would not be surprised if people tried to use it just as an experiment and for its entertainment value once or maybe twice. After all, I invented the multiple strategy support for amusement, not from any practical real world needs ;-)
So I do not consider that a convincing argument at all.
Quoted 6 lines
... or even a single _wrong_ one. So:
$ git merge -s stupid -Xourswould not fail at all, but definitely not do the right thing either (it disobeys a direct command of the user).
It does fail gracefully, though.
$ git merge -s resolve -Xours next
Trying really trivial in-index merge...
error: Untracked working tree file '.gitattributes' would be overwritten by merge.
Nope.
fatal: Not a valid object name --ours
Merge with strategy resolve failed.I consider this falls into "You say it hurts? Don't do that, then" category.
The error message will naturally improve, once we teach the merge strategy backends that they can be given --<option> in front of the usual <base>... -- <ents>... parameters, and there is no risk of ambiguity because no object names begin with a dash.
Having said all that, I do not have any reason to push for -Xours/theirs myself. I've made myself very clear from the beginning that what these options do is a bad idea, just as "-s theirs" is a bad idea. These encourage a broken workflow and I do not see a clear upside, however narrow, and you and Pasky seem to agree with me (heh, isn't it a rare occasion that all three of us agree on something these days? ;-)
I won't shed tears to see them go.
However, I do think it is wrong to deny that it will eventually be necessary for us to be able to pass strategy specific options via the git-merge frontend driver to the strategy backend. The primary reason why I wrote "subtree" strategy to _guess_ how to shift trees was because there was no way to pass "how the end user wants to shift them" to the strategy backend over "pull -- merge -- merge-subtree" callchain. Coming up with the algorithm was fun, but that was secondary.
If we allow users to say -Xsubtree=<path>, it would be a true improvement to a tool that is used in real life. Unlike "multiple -s strategy" support that I think nobody ever uses in practice (on which part of your objection is based), "-s subtree" has been useful in real life, and you can verify that claim easily by counting how many times I've used that in git.git history yourself.
Even though I do not care deeply about the syntax (and if you do not like the "-X" as the external option introducer, you are welcome to pick a different notation and send in a patch), it would help for example the vanilla "recursive" strategy to allow the user, when dealing with really tricky merge, to influence the rename threshold score it uses by passing it as a strategy-specific option.
As a conclusion of this discussion, I'll discard xx/merge-in-c-into-next branch from "next", at the beginning of post-1.6.0 cycle. We might in the future need to resurrect only the -X<option> part to allow us to pass strategy specific options (that are not "ours/theirs"), but there is no immediate need for it, other than -Xsubtree=<path>. If somebody wants to step up and give the custom rename threshold to the recursive strategy, keeping that code to do -X<option> might help that too, though.
Hi,
Quoted 11 lines · Junio C Hamano
Quoted 8 lines · Johannes Schindelin
Documentation/merge-strategies.txt recursive:: · line 31
Quoted 3 lines · Junio C Hamano
Documentation/merge-strategies.txt +3
-0+The 'recursive' strategy can take the following options: + +ours;;You still have not addressed the issue that you can specify multiple strategies,...
Quoted 6 lines
Even though multiple -s parameters are supported, I know you have been here long enough in git scene to remember how it came about. I've seen some third-party documents that talk about our ability to "try multiple strategies and pick the best one" as one of the unique features, but anybody who was there knows that it was just a failed experiment that we did not bother removing.
I think that we made it hard for that experiment to succeed, by disallowing custom merge strategies.
See
http://git.or.cz/gitwiki/SoC2007Ideas#head-cfde15f16950c2579a89cc109762e911546e6fe3
for an idea that would make complete sense as a _fallback_ strategy. Fallback, because it is definitely too slow to be the default.
Yes, I agree, if all strategies fail, it is dubitable that we find a metric that will always find the "best" one. But if one fails and the next one does not, it is obvious what is correct.
So I still feel that "-s subtree=<blabla>,recursive=theirs" would be a viable way to go. And more intuitive than "-X".
I'll just ask Miklos what he thinks of the idea, and to write the patch if he likes it, once he's back from the saddle. :-)
Ciao,
Dscho
Quoted 3 lines · Johannes Schindelin
Yes, I agree, if all strategies fail, it is dubitable that we find a metric that will always find the "best" one. But if one fails and the next one does not, it is obvious what is correct.
Not at all. Imagine the case where one of them is either ours or theirs.
Hi,
Quoted 8 lines · Junio C Hamano
Quoted 3 lines · Johannes Schindelin
Yes, I agree, if all strategies fail, it is dubitable that we find a metric that will always find the "best" one. But if one fails and the next one does not, it is obvious what is correct.
Not at all. Imagine the case where one of them is either ours or theirs.
But then it is not the _default_ at all!
It is what the _user_ _asked_ for.
So this is what the user gets.
With Git, the user is not ignored (like GNOME does, to "help" the user). With Git, the user _gets_ what she asked for, even if the question does not make sense.
Ciao,
Dscho
Quoted 5 lines · Johannes Schindelin
So I still feel that "-s subtree=<blabla>,recursive=theirs" would be a viable way to go. And more intuitive than "-X".
I'll just ask Miklos what he thinks of the idea, and to write the patch if he likes it, once he's back from the saddle. :-)
I think there are three steps here.
First, currently you can specify multiple strategies in the config (pull.twohead, pull.octopus) using a space separated list. If we want to change it to a coma-separated list, should we care about backwards compatibility? There are tests for this, but it's undocumented (and my patch to document it was rejected, saying we should not encourage people to use it).
Second, we could allow custom strategies, as we started to discuss here:
http://thread.gmane.org/gmane.comp.version-control.git/86584/focus=87684
Third, it would be nice to allow passing extra parameter(s) to the backends, but I do not know what concept is the best here. The strategy1=foo,stategy2=bar limits the input to a single string. Is that enough? Given that recursive=theirs was considered harmful, we don't have too much examples; for subtree the only parameter I could think of is the path, so a string there is enough.
However, further strategies, like blame, could take more parameters, like git blame -C<num> -M<othernum>. Or do I just overcomplicate it? ;-)
Quoted 5 lines · Miklos Vajna
Third, it would be nice to allow passing extra parameter(s) to the backends, but I do not know what concept is the best here. The strategy1=foo,stategy2=bar limits the input to a single string. Is that enough? Given that recursive=theirs was considered harmful, we don't have too much examples;...
I personally think -sstrategy=string1,string2,... is simply a bad taste.
Why force yourself to parse things by having the users to concatenate something that the user could give us separated? If you care about the order and association between strategy and their options, you can always do:
-s strategy1 -X option-1-for-strategy-1 -X option-2-for-strategy-1 \ -s strategy2 -X option-1-for-strategy-2 ...
Hi,
Quoted 10 lines · Junio C Hamano
Quoted 5 lines · Miklos Vajna
Third, it would be nice to allow passing extra parameter(s) to the backends, but I do not know what concept is the best here. The strategy1=foo,stategy2=bar limits the input to a single string. Is that enough? Given that recursive=theirs was considered harmful, we don't have too much examples;...
I personally think -sstrategy=string1,string2,... is simply a bad taste.
Quoted 7 lines
Why force yourself to parse things by having the users to concatenate something that the user could give us separated? If you care about the order and association between strategy and their options, you can always do:
-s strategy1 -X option-1-for-strategy-1 -X option-2-for-strategy-1 \ -s strategy2 -X option-1-for-strategy-2 ...
You mean something like
$ git merge -s subtree -X --path -X git-gui/ git-gui/master
Wow. :-)
Speechless,
Dscho
Quoted 7 lines · Johannes Schindelin
Quoted 7 lines
I personally think -sstrategy=string1,string2,... is simply a bad taste.
Why force yourself to parse things by having the users to concatenate something that the user could give us separated? If you care about the order and association between strategy and their options, you can always do:
Quoted 8 lines
Quoted 2 lines
-s strategy1 -X option-1-for-strategy-1 -X option-2-for-strategy-1 \ -s strategy2 -X option-1-for-strategy-2 ...You mean something like
$ git merge -s subtree -X --path -X git-gui/ git-gui/masterWow. :-)
I would envision it to be more like:
$ git merge -s subtree -Xpath=git-gui git-gui/master
which git-merge internally would turn into:
$ git-merge-subtree --path=git-gui HEAD -- OURS THEIRS
That way both the external command line (that the end users do care about) and the internal one (that the strategy programmer would care about) look a lot more sensible than your command line, don't they?
Quoted 10 lines · Junio C Hamano
Quoted 5 lines · Johannes Schindelin
You mean something like
$ git merge -s subtree -X --path -X git-gui/ git-gui/masterWow. :-)
I would envision it to be more like:
$ git merge -s subtree -Xpath=git-gui git-gui/master
Whatever happened to quotes?
$ git merge -s subtree -Xpath="git-gui git-gui/master"
Signature · 3 lines
Cheers, Sverre Rabbelier
Quoted 8 lines · Sverre Rabbelier
Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Johannes Schindelin
You mean something like
$ git merge -s subtree -X --path -X git-gui/ git-gui/masterWow. :-)
Quoted 7 lines
Quoted 3 lines
I would envision it to be more like:
$ git merge -s subtree -Xpath=git-gui git-gui/masterWhatever happened to quotes?
$ git merge -s subtree -Xpath="git-gui git-gui/master"
Read again what did you wrote. ;-)
The current form is
git merge -s subtree git-gui/master, so at most it could be
$ git merge -s subtree -Xpath="git-gui" git-gui/master
Quoted 5 lines · Miklos Vajna
Quoted 3 lines · Sverre Rabbelier
Whatever happened to quotes?
$ git merge -s subtree -Xpath="git-gui git-gui/master"
Quoted 7 lines
Read again what did you wrote. ;-)
The current form is
git merge -s subtree git-gui/master, so at most it could be
$ git merge -s subtree -Xpath="git-gui" git-gui/master
Meh, what I ofcourse mean was:
$ git merge -s subtree -X"path=git-gui" git-gui/master
But that looks rather awkward, which is probably why I typed it the way I did? Maybe something like....
$ git merge -s subtree -X(--path=git-gui --foo=bar) git-gui/master
Signature · 3 lines
Cheers, Sverre Rabbelier
Quoted 12 lines · Sverre Rabbelier
Quoted 11 lines · Miklos Vajna
Quoted 3 lines · Sverre Rabbelier
Whatever happened to quotes?
$ git merge -s subtree -Xpath="git-gui git-gui/master"Read again what did you wrote. ;-)
The current form is
git merge -s subtree git-gui/master, so at most it could be
Quoted 8 lines
Quoted 1 line
$ git merge -s subtree -Xpath="git-gui" git-gui/masterMeh, what I of course mean was:
$ git merge -s subtree -X"path=git-gui" git-gui/masterBut that looks rather awkward, which is probably why I typed it the way I did? Maybe something like....
$ git merge -s subtree -X(--path=git-gui --foo=bar) git-gui/master
Or perhaps (following -Wx family of GCC options)
$ git merge -s subtree -X--path=git-gui,--foo=bar git-gui/master
Signature · 3 lines
Jakub Narebski Poland ShadeHawk on #git
Quoted 3 lines · Sverre Rabbelier
Whatever happened to quotes?
$ git merge -s subtree -Xpath="git-gui git-gui/master"
Nothing special needs to happen. That would naturally be passed to the underlying strategy as the equivalent of:
$ git merge-subtree --path="git-gui git-gui/master"
but now "git-merge" is in C, it does not have to quote nor unquote explicitly itself. Unquoting will be done by the shell when you call "git-merge", and quoting is unneeded when you give each argument as a separate string in **argv to call execv().
Hi,
Quoted 22 lines · Junio C Hamano
Quoted 7 lines · Johannes Schindelin
Quoted 7 lines
I personally think -sstrategy=string1,string2,... is simply a bad taste.
Why force yourself to parse things by having the users to concatenate something that the user could give us separated? If you care about the order and association between strategy and their options, you can always do:
Quoted 8 lines
Quoted 2 lines
-s strategy1 -X option-1-for-strategy-1 -X option-2-for-strategy-1 \ -s strategy2 -X option-1-for-strategy-2 ...You mean something like
$ git merge -s subtree -X --path -X git-gui/ git-gui/masterWow. :-)
I would envision it to be more like:
$ git merge -s subtree -Xpath=git-gui git-gui/master
Quoted 7 lines
which git-merge internally would turn into:
$ git-merge-subtree --path=git-gui HEAD -- OURS THEIRSThat way both the external command line (that the end users do care about) and the internal one (that the strategy programmer would care about) look a lot more sensible than your command line, don't they?
I still find it a lot easier to explain
$ git -s subtree=git-gui git-gui/master
to a new user than your command line, especially since
$ git -X path=git-gui -s subtree git-gui/master
would be a not so obvious mistake, _and_ especially since the implementation of your option parsing would be rather ugly.
But the subject has been discussed to death, and you seem to still prefer the -X way, so I give up.
You win,
Dscho "who can adapt even to a syntax he does not like"
Hi,
Quoted 2 lines · Miklos Vajna
First, currently you can specify multiple strategies in the config (pull.twohead, pull.octopus) using a space separated list.
Oh, I did not mean to change that. I just misremembered.
Quoted 3 lines
Second, we could allow custom strategies, as we started to discuss here:
http://thread.gmane.org/gmane.comp.version-control.git/86584/focus=87684
In my opinion, this would make it easier for interested parties to start implementing that blame-based merge strategy I mentioned.
Quoted 9 lines
Third, it would be nice to allow passing extra parameter(s) to the backends, but I do not know what concept is the best here. The strategy1=foo,stategy2=bar limits the input to a single string. Is that enough? Given that recursive=theirs was considered harmful, we don't have too much examples; for subtree the only parameter I could think of is the path, so a string there is enough.
However, further strategies, like blame, could take more parameters, like git blame -C<num> -M<othernum>. Or do I just overcomplicate it? ;-)
The common solution is like with gcc's -Wl option, which translates commata into spaces, like so: "-Wl,--machine,i386" is added as "--machine i386" to the linker command line.
Our own cvsimport implements the same principle:
$ git cvsimport -p -b,HEAD
will only update the main branch.
Ciao,
Dscho
Hi,
Quoted 9 lines · Nanako Shiraishi
Quoting Junio C Hamano <[email protected]>:
Quoted 7 lines
* xx/merge-in-c-into-next (Wed Jul 9 13:51:46 2008 -0700) 4 commits
+ Teach git-merge -X<option> again.
+ Merge branch 'jc/merge-theirs' into xx/merge-in-c-into-next
+builtin-merge.c: useparse_options_step()"incremental parsing" machinery
+ Merge branch 'ph/parseopt-step-blame' into xx/merge-in-c-into-next
Quoted 7 lines
Quoted 3 lines
This needs to be merged to master iff/when merge-theirs gets merged, but I do not think this series is widely supported, so both are on hold.
Why do you say it is not widely supported? I may be wrong but I think you developed these patches after somebody from the mailing list asked for this feature.
Asking for a feature, and then not doing a single thing to defend why it makes sense, of a single person, who does not even speak up now, does not count for "wide support".
Ciao,
Dscho
Quoting Johannes Schindelin <[email protected]>:
Quoted 7 lines · Nanako Shiraishi
Quoted 6 lines
Quoting Junio C Hamano <[email protected]>:
Quoted 3 lines
This needs to be merged to master iff/when merge-theirs gets merged, but I do not think this series is widely supported, so both are on hold.
Quoted 7 lines
Quoted 3 lines
Why do you say it is not widely supported? I may be wrong but I think you developed these patches after somebody from the mailing list asked for this feature.
Asking for a feature, and then not doing a single thing to defend why it makes sense, of a single person, who does not even speak up now, does not count for "wide support".
For the record, I was not the one who asked for such a feature.
It seems that the conclusion of the discussion is that "theirs" promotes a bad workflow, and I am happy with that.
Signature · 2 lines
Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' while commits prefixed with '+' are in 'next'.
The topics list the commits in reverse chronological order. The topics meant to be merged to the maintenance series have "maint-" in their names.
Due to increased activity level from people including GSoC students, I expect 'next' to stay somewhat more active than previous rounds during the 1.6.0-rc cycle. The request for people who usually follow 'next' is the same as usual, though. After -rc1 is tagged, please run 'master' for your daily git use instead, in order to make sure 'master' does what it claims to do without regression.
Tentative schedule, my wishful thinking:
- 1.6.0-rc0 (Jul 20)
- 1.6.0-rc1 (Jul 23)
- 1.6.0-rc2 (Jul 30)
- 1.6.0-rc3 (Aug 6)
- 1.6.0 (Aug 10)
No real activity on 'next', as I was busy tending bugfixes and pushing out v1.5.6.4 today.
----------------------------------------------------------------
[Will merge to "master" soon]
* ns/am-abort (Wed Jul 16 19:39:10 2008 +0900) 1 commit
+ git am --abort
This one is for Ted; builds on top of the recent "am and rebase leaves ORIG_HEAD just like reset, merge and pull does" rather nicely.
* jc/rerere-auto-more (Wed Jul 16 20:25:18 2008 -0700) 1 commit
+ rerere.autoupdate: change the message when autoupdate is in effect
This one is for Ingo.
This changes the message rerere issues after reusing previous conflict resolution from "Resolved" to "Staged" when autoupdate option is in effect.
It is envisioned that in practice, some auto resolutions are trickier and iffier than others, and we would want to add a feature to mark individual resolutions as "this is ok to autoupdate" or "do not autoupdate the result using this resolution even when rerere.autoupdate is in effect" in the future. When that happens, these messages will make the distinction clearer.
* ap/trackinfo (Wed Jul 16 15:19:27 2008 -0400) 1 commit
+ Reword "your branch has diverged..." lines to reduce line length
----------------------------------------------------------------
[Stalled/Needs more work]
* rs/imap (Wed Jul 9 22:29:02 2008 +0100) 5 commits
- Documentation: Improve documentation for git-imap-send(1)
- imap-send.c: more style fixes
- imap-send.c: style fixes
- git-imap-send: Support SSL
- git-imap-send: Allow the program to be run from subdirectories of a git tree
I said: "Some people seem to prefer having this feature available also with gnutls. If such a patch materializes soon, that would be good, but otherwise I'll merge this as-is to 'next'. Such an enhancement can be done in-tree on top of this series." Anybody?
* gi/cherry-cache (Sat Jul 12 20:14:51 2008 -0700) 1 commit . cherry: cache patch-ids to avoid repeating work
The discussion suggested that the value of having the cache itself is iffy, but I should pick up the updated one and look at it.
* lw/gitweb (Fri Jul 11 03:11:48 2008 +0200) 3 commits . gitweb: use new Git::Repo API, and add optional caching . Add new Git::Repo API
. gitweb: add test suite with Test::WWW::Mechanize::CGI
* sb/sequencer (Tue Jul 1 04:38:34 2008 +0200) 4 commits . Migrate git-am to use git-sequencer
. Add git-sequencer test suite (t3350)
. Add git-sequencer prototype documentation
. Add git-sequencer shell prototype
I haven't looked at the updated series yet. I should, but nobody else seems to be looking at these patches, which is somewhat depressing but understandable. Summer is slower ;-)
* pb/submodule (Wed Jul 16 21:11:40 2008 +0200) 7 commits . t7403: Submodule git mv, git rm testsuite
. git rm: Support for removing submodules
. git mv: Support moving submodules
. submodule.*: Introduce simple C interface for submodule lookup by
path
. git submodule add: Fix naming clash handling
. t7400: Add short "git submodule add" testsuite
. git-mv: Remove dead code branch
Long overdue usability improvement series for submodule. Very much welcomed. It would be nice to have some submodule improvements in 1.6.0, but it would take us a few more rounds to hit 'next' with this, and it will not be in 'master' when 1.6.0 ships.
* jc/grafts (Wed Jul 2 17:14:12 2008 -0700) 1 commit
- [BROKEN wrt shallow clones] Ignore graft during object transfer
Cloning or fetching from a repository from grafts did not send objects that are hidden by grafts, but the commits in the resulting repository do need these to pass fsck. This fixes object transfer to ignore grafts.
Another fix is needed to git-prune so that it ignores grafts but treats commits that are mentioned in grafts as reachable.
* jc/blame (Wed Jun 4 22:58:40 2008 -0700) 2 commits
- blame: show "previous" information in --porcelain/--incremental format
- git-blame: refactor code to emit "porcelain format" output
This is for peeling the line from the blamed version to see what's behind it, which may or may not help applications like gitweb.
----------------------------------------------------------------
[Will drop]
* xx/merge-in-c-into-next (Wed Jul 9 13:51:46 2008 -0700) 4 commits
+ Teach git-merge -X<option> again.
+ Merge branch 'jc/merge-theirs' into xx/merge-in-c-into-next
+ builtin-merge.c: use parse_options_step() "incremental parsing" machinery
+ Merge branch 'ph/parseopt-step-blame' into xx/merge-in-c-into-next
* jc/merge-theirs (Fri Jul 18 02:43:00 2008 -0700) 6 commits
- Document that merge strategies can now take their own options
+ Make "subtree" part more orthogonal to the rest of merge- recursive.
+ Teach git-pull to pass -X<option> to git-merge
+ Teach git-merge to pass -X<option> to the backend strategy module
+ git-merge-recursive-{ours,theirs}
+ git-merge-file --ours, --theirs
It appears nobody wants "theirs" nor "ours", so I'll soon apply a wholesale revert for these series to 'next', and then these will be dropped when we rewind 'next' after 1.6.0 final.
Please make sure next time somebody asks "ours/theirs" merge on the list and #git s/he is quickly told that it was unanimously rejected so that people do not have to waste time rehashing the topic ever again.
----------------------------------------------------------------
[On Hold]
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config variables
This was previously in "will be in master soon" category, but it turns out that the synonyms to the ones this one deletes are fairly new invention that happend in 1.5.6 timeframe, and we cannot do this just yet. Perhaps in 1.7.0.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0 timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
- diff: enable "too large a rename" warning when -M/-C is explicitly asked for
This would be the right thing to do for command line use, but gitk will be hit due to tcl/tk's limitation, so I am holding this back for now.
Quoted 10 lines · Junio C Hamano
* pb/submodule (Wed Jul 16 21:11:40 2008 +0200) 7 commits . t7403: Submodule git mv, git rm testsuite
. git rm: Support for removing submodules
. git mv: Support moving submodules
. submodule.*: Introduce simple C interface for submodule lookup by
path
. git submodule add: Fix naming clash handling
. t7400: Add short "git submodule add" testsuite
. git-mv: Remove dead code branch
Quoted 4 lines
Long overdue usability improvement series for submodule. Very much welcomed. It would be nice to have some submodule improvements in 1.6.0, but it would take us a few more rounds to hit 'next' with this, and it will not be in 'master' when 1.6.0 ships.
Do you think this would create serious problems?
One thing this patch series depends on now is changing the git mv semantics in a rather non-trivial way, which is something we might want to do in a major release instead of within the 1.6 series.
Petr "Pasky" Baudis
Quoted 5 lines · Petr Baudis
Do you think this would create serious problems?
One thing this patch series depends on now is changing the git mv semantics in a rather non-trivial way, which is something we might want to do in a major release instead of within the 1.6 series.
The change to git-mv perhaps is necessary to happen between a major release boundary. I do not know if the current round of patch to do so will become ready in time for 1.6.0. The rename-ce-at patch I looked at did not look like it was.
Quoted 3 lines · Junio C Hamano
*
/usr/bin/git-cat-fileis no more. The bulk of the git commands will move to/usr/libexec/git-core/or somesuch.
Every time I read this note I do a double-take.
To me, the first sentence means that 'cat-file' command is gone. Then, the second sentence is just gibberish. And since I understand what you _want_ to say, I then go back and parse it properly, and know that you don't actually mean that git-cat-file is removed, but that it's removed from being accessible under that name in the path.
So to avoid my double-take, and hopefully avoid confusion for other people, can you please make your status report rephrase that thing.
Maybe just say
* Do not install all git subcommands as 'git-xyzzy' files in the user path. This avoids unnecessary hardlinks (or copies on systems that do not support links), and enforces the 'git xyzzy' syntax.
Subcommands that aren't builtins now get installed in /usr/libexec/git-core/ or somesuch.
(I haven't looked at the series, but I _assume_ it also avoids installing the builtin subcommands entirely when not necessary, ie "git-cat-file" really _is_ gone, but it's not because the "cat-file" command itself is gone).
Hmm? Or maybe it's just me who gets confused by the phrasing.
Linus
Quoted 8 lines · Linus Torvalds
Maybe just say
* Do not install all git subcommands as 'git-xyzzy' files in the user path. This avoids unnecessary hardlinks (or copies on systems that do not support links), and enforces the 'git xyzzy' syntax.
Subcommands that aren't builtins now get installed in
/usr/libexec/git-core/or somesuch.
Thanks.
Quoted 4 lines
(I haven't looked at the series, but I _assume_ it also avoids installing the builtin subcommands entirely when not necessary, ie "git-cat-file" really _is_ gone, but it's not because the "cat-file" command itself is gone).
It is actually a fairly long road ahead.
In 1.6.0, most of them will be moved to /usr/libexec/git-core/, so that really old scripts end users may have can be more easily kept working by simply saying:
PATH=$(git --exec-path):$PATH
early, without doing "s/git-/git /g".
Current git clients run git-upload-pack and friends in "git-xyzzy" form when accessing remote repositories directly over ssh, so in 1.6.0 we will have to leave these server side programs in $(bindir) as well.
git-shell and gitosis is being updated to accept "git upload-pack" form as well, and after older versions of these programs die out, we can update the clients to ask for remote side programs without dash.
None of the server side programs is built-in, so we could start the hardlink removal independent from this transition (iow, "Only subcommands that aren't builtin will be installed in libexec, builtins are not on the disk anywhere" could happen now), but I'd prefer to keep changes in each steps small to minimize impacts to the end users' environments.
Quoted 1 line · Linus Torvalds
To me, the first sentence means that 'cat-file' command is gone....
Here is a replacement I am preparing, taken from the draft release notes to 1.6.0:
* With the default Makefile settings, most of the programs will be installed outside your $PATH, except for "git", "gitk", "git-gui" and some server side programs that need to be accessible for technical reasons. Invoking a git subcommand as "git-xyzzy" from the command line has been deprecated since early 2006 (and officially announced in 1.5.4 release notes); use of them from your scripts after adding output from "git --exec-path" to the $PATH will still be supported in 1.6.0, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
Quoted 6 lines · Junio C Hamano
use of them from your scripts after adding
output from "git --exec-path" to the $PATH will still be supported
in
1.6.0, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
I think msysgit doesn't (didn't?) install the hardlinks to conserve space, as Windows doesn't support hard links. Perhaps we should mention that as well?
- Pieter
Quoted 10 lines · Pieter de Bie
Quoted 6 lines · Junio C Hamano
use of them from your scripts after adding
output from "git --exec-path" to the $PATH will still be supported
in
1.6.0, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
Quoted 3 lines
I think msysgit doesn't (didn't?) install the hardlinks to conserve space, as Windows doesn't support hard links. Perhaps we should mention that as well?
Windows does support hardlinks and msysgit uses them.
Steffen
Hi,
Quoted 10 lines · Pieter de Bie
Quoted 5 lines · Junio C Hamano
use of them from your scripts after adding output from "git --exec-path" to the $PATH will still be supported in 1.6.0, but users are again strongly encouraged to adjust their scripts to use "git xyzzy" form, as we will stop installing "git-xyzzy" hardlinks for built-in commands in later releases.
I think msysgit doesn't (didn't?) install the hardlinks to conserve space, as Windows doesn't support hard links.
Please do not spread FUD. Where available, we install hardlinks.
And even if we did not, given that we do not yet actively support MinGW, I think your suggestion is a bit early, to say the least.
Ciao,
Dscho
Quoted 3 lines · Junio C Hamano
* jc/reflog-expire (Sat Jun 28 22:24:49 2008 -0700) 2 commits
- Make default expiration period of reflog used for stash infinite
- Per-ref reflog expiry configuration
Thanks.
-brandon
PATCH 1/1 Teach git-merge to pass -X<option> to the backend strategy module
In reply to Junio C HamanoDistinguishing slight variation of modes of operation between the vanilla merge-recursive and merge-recursive-ours by the command name may have been an easy way to experiment, but we should bite the bullet and allow backend specific options to be given by the end user.
---
Quoted 10 lines
[Stalled/Needs more work]
* jc/merge-theirs (Fri Jun 20 00:17:59 2008 -0700) 2 commits
- git-merge-recursive-{ours,theirs}
- git-merge-file --ours, --theirsPunting a merge by discarding your own work in conflicting parts but still salvaging the parts that are cleanly automerged. It is likely that this will result in nonsense mishmash, but somehow often people want this, so here they are. The interface to the backends may need to change, though.
Makefile | 3 --- builtin-merge-recursive.c | 23 +++++++++++++++-------- git-merge.sh | 11 ++++++++--- t/t6034-merge-ours-theirs.sh | 4 ++-- 4 files changed, 25 insertions(+), 16 deletions(-)
Makefile +0 -3
@@ -304,8 +304,6 @@ BUILT_INS += git-format-patch$X BUILT_INS += git-fsck-objects$X BUILT_INS += git-get-tar-commit-id$X BUILT_INS += git-init$X -BUILT_INS += git-merge-recursive-ours$X -BUILT_INS += git-merge-recursive-theirs$X BUILT_INS += git-merge-subtree$X BUILT_INS += git-peek-remote$X BUILT_INS += git-repo-config$X
@@ -1383,7 +1381,6 @@ check-docs:: do \ case "$$v" in \ git-merge-octopus | git-merge-ours | git-merge-recursive | \ - git-merge-recursive-ours | git-merge-recursive-theirs | \ git-merge-resolve | git-merge-stupid | git-merge-subtree | \ git-fsck-objects | git-init-db | \ git-?*--?* ) continue ;; \
builtin-merge-recursive.c +15 -8
@@ -1407,12 +1407,6 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)if (8 < namelen && !strcmp (argv[0 ] + namelen -8 ,"-subtree" )) merge_recursive_variants =MERGE_RECURSIVE_SUBTREE ; -else if (5 < namelen && - !strcmp (argv[0 ] + namelen -5 ,"-ours" )) - merge_recursive_variants =MERGE_RECURSIVE_OURS ; -else if (7 < namelen && - !strcmp (argv[0 ] + namelen -7 ,"-theirs" )) - merge_recursive_variants =MERGE_RECURSIVE_THEIRS ; }git_config (merge_config,NULL );
@@ -1423,8 +1417,21 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)die ("Usage: %s <base>... -- <head> <remote> ...\n" , argv[0 ]);for (i =1 ; i < argc; ++i) { -if (!strcmp (argv[i],"--" )) -break ; +const char *arg = argv[i]; + +if (!prefixcmp (arg,"--" )) { +if (!arg[2 ]) +break ; +if (!strcmp (arg+2 ,"ours" )) + merge_recursive_variants =MERGE_RECURSIVE_OURS ; +else if (!strcmp (arg+2 ,"theirs" )) + merge_recursive_variants =MERGE_RECURSIVE_THEIRS ; +else if (!strcmp (arg+2 ,"subtree" )) + merge_recursive_variants =MERGE_RECURSIVE_SUBTREE ; +else +die ("Unknown option %s" , arg); +continue ; + }if (bases_count <sizeof (bases)/sizeof (*bases)) bases[bases_count++] = argv[i]; }
git-merge.sh +8 -3
@@ -17,6 +17,7 @@ commit perform a commit if the merge succeeds (default) ff allow fast forward (default) s,strategy= merge strategy to use m,message= message to be used for the merge commit (if any) +X= pass merge strategy specific options " SUBDIRECTORY_OK=Yes
@@ -31,12 +32,12 @@ LF=' ' all_strategies='recur recursive octopus resolve stupid ours subtree' -all_strategies="$all_strategies recursive-ours recursive-theirs" default_twohead_strategies='recursive' default_octopus_strategies='octopus' no_fast_forward_strategies='subtree ours' -no_trivial_strategies='recursive recur subtree ours recursive-ours recursive-theirs' +no_trivial_strategies='recursive recur subtree ours' use_strategies= +backend_option= allow_fast_forward=t allow_trivial_merge=t
@@ -187,6 +188,10 @@ parse_config () { merge_msg="$1" have_message=t ;; + -X) + shift + backend_option="$backend_option --$1" + ;; --) shift break ;;
@@ -451,7 +456,7 @@ do # Remember which strategy left the state in the working tree wt_strategy=$strategy - git-merge-$strategy $common -- "$head_arg" "$@" + git-merge-$strategy $backend_option $common -- "$head_arg" "$@" exit=$? if test "$no_commit" = t && test "$exit" = 0 then
t/t6034-merge-ours-theirs.sh +2 -2
@@ -35,7 +35,7 @@ test_expect_success 'plain recursive - should conflict' ' test_expect_success 'recursive favouring theirs' ' git reset --hard master && - git merge -s recursive-theirs side && + git merge -s recursive -Xtheirs side && ! grep nine file && grep nueve file && ! grep 9 file &&
@@ -45,7 +45,7 @@ test_expect_success 'recursive favouring theirs' ' test_expect_success 'recursive favouring ours' ' git reset --hard master && - git merge -s recursive-ours side && + git merge -s recursive -Xours side && grep nine file && ! grep nueve file && ! grep 9 file &&
Signature · 1 line
1.5.6.1.102.g8e69d
Re: [PATCH] Teach git-merge to pass -X<option> to the backend strategy module
Quoted 10 lines · Junio C Hamano
git-merge.sh +0
-0@@ -17,6 +17,7 @@ commit perform a commit if the merge succeeds (default) ff allow fast forward (default)s,strategy= merge strategy to use
m,message= message to be used for the merge commit (if any) +X= pass merge strategy specific options "
You have updated usage for git-merge, but didn't update manpages (Documentation).
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git
Re: [PATCH] Teach git-merge to pass -X<option> to the backend strategy module
Quoted 15 lines · Jakub Narebski
Quoted 10 lines · Junio C Hamano
git-merge.sh +0
-0@@ -17,6 +17,7 @@ commit perform a commit if the merge succeeds (default) ff allow fast forward (default)s,strategy= merge strategy to use
m,message= message to be used for the merge commit (if any) +X= pass merge strategy specific options "You have updated usage for git-merge, but didn't update manpages (Documentation).
Patches welcome ;-)
Quoted 7 lines · Junio C Hamano
[Stalled]
* dr/ceiling (Mon May 19 23:49:34 2008 -0700) 4 commits
- Eliminate an unnecessarychdir("..")
- Add support forGIT_CEILING_DIRECTORIES
- Fold test-absolute-path into test-path-utils
- Implementnormalize_absolute_path
The most recent version of this patch seemed to come and go without any commentary one way or the other. What are people's objections to it as it stands now?
-Steve
Hi,
Quoted 6 lines · Junio C Hamano
* js/config-cb (Wed May 14 18:46:53 2008 +0100) 1 commit
- Providegit_configwith a callback-data parameterThis needs to wait until most of the other things graduate for 1.5.6; luckily, unlike the other "path-list" changes, misconversions is much easier to catch for this change and I am not worried about it.
Just let me know when to resubmit, and against what branch(es).
Quoted 8 lines
* js/mailinfo (Fri May 16 14:03:30 2008 +0100) 1 commit
- <<PARK - BASE64 and QP still broken>> mailsplit and mailinfo:
gracefully handle NUL charactersWhen "am" processes a patch that modifies a line with NUL, we used to chomp the patch line there, resulting in rejects. This patch fixes the issue partially, only when the message is not encoded in BASE64 nor Quoted-Printable.
Like I said, I would be happy if Tommy took care of that patch.
Quoted 4 lines
* js/ignore-submodule (Wed May 14 18:03:59 2008 +0100) 3 commits
+ Ignore dirty submodule states during rebase and stash
+ Teach update-index about --ignore-submodules
+ diff options: Introduce --ignore-submodules
I haven't heard back from you about renaming that option. I think I suggested --non-gitlinks or something equally discouraging for porcelain users.
Quoted 7 lines
* as/graph (Mon May 5 00:57:03 2008 -0700) 4 commits
+ graph API: eliminate unnecessary indentation
+ log and rev-list: add --graph option
+ Add history graph API
+ revision API: split parent rewriting and parent printing optionsDraw "tig 'g'" graph without tig ;-)
I am a big fan of this feature.
Quoted 4 lines
* db/clone-in-c (Tue May 20 14:15:14 2008 -0400) 11 commits
+ clone: fall back to copying if hardlinking fails
+builtin-clone.c: Need toclosedir()incopy_or_link_directory()
+ builtin-clone: fix initial checkout
Quoted 8 lines
+ Build in clone
+ Provide API access toinit_db()
+ Add a function to set a non-default work tree
+ Allow for havingfor_each_ref()list extra refs
+ Have a constant extern refspec for "--tags"
+ Add a library function to add an alternate to the alternates file
+ Add a lockfile function to append to a file
+ Mark the list of refs to fetch as const
Fingers crossed.
Quoted 19 lines
* js/rebase-i-sequencer (Sun Apr 27 02:55:50 2008 -0400) 17 commits
+ Use perl instead of tac
+ Fix t3404 assumption thatwc -ldoes not use whitespace.
+ rebase -i: Use : in expr command instead of match.
+ rebase -i: update the implementation of 'mark' command
+ Add option --preserve-tags
+ Teach rebase interactive the tag command
+ Add option --first-parent
+ Do rebase with preserve merges with advanced TODO list
+ Select all lines with fake-editor
+ Unify the length of $SHORT* and the commits in the TODO list
+ Teach rebase interactive the merge command
+ Move redo merge code in a function
+ Teach rebase interactive the reset command
+ Teach rebase interactive the mark command
+ Move cleanup code into it's own function
+ Don't append default merge message to -m message
+ fake-editor: output TODO list if unchanged
Quoted 4 lines
This may complement the proposed "sequencer" GSoC project. Dscho seems to have quite a strong objection to the 'mark' syntax and mechanism being unnecessarily complex. Let's wait and see if a less complex but equally expressive alternative materializes...
Yeah, I know. My backlog is growing and growing.
Ciao,
Dscho
Hi,
Quoted 1 line
Quoted 1 line
* js/rebase-i-sequencer (Sun Apr 27 02:55:50 2008 -0400) 17 commits
esp.
Quoted 3 lines
Quoted 3 lines
+ Teach rebase interactive the merge command
+ Teach rebase interactive the reset command
+ Teach rebase interactive the mark command
[...]
Quoted 2 lines
Yeah, I know. My backlog is growing and growing.
I think, this week we get the git-sequencer "spec" ready to be sent to the list.
Then there's a new thread to discuss ;-)
Regards,
Stephan
Signature · 1 line
Stephan Beyer <[email protected]>, PGP 0x6EDDD207FCC5040F
Quoted 8 lines · Johannes Schindelin
Quoted 6 lines
* js/config-cb (Wed May 14 18:46:53 2008 +0100) 1 commit
- Providegit_configwith a callback-data parameterThis needs to wait until most of the other things graduate for 1.5.6; luckily, unlike the other "path-list" changes, misconversions is much easier to catch for this change and I am not worried about it.
Just let me know when to resubmit, and against what branch(es).
It is probably easier for me to munge the original submission from you when I decide to tag -rc0, adjusting any potential new callers (I do not think of any offhand in diff between master and next). We will need a quiescent time for this kind of change, and that way we will get such a quiescent window by definition.
Quoted 10 lines
Quoted 8 lines
* js/mailinfo (Fri May 16 14:03:30 2008 +0100) 1 commit
- <<PARK - BASE64 and QP still broken>> mailsplit and mailinfo:
gracefully handle NUL charactersWhen "am" processes a patch that modifies a line with NUL, we used to chomp the patch line there, resulting in rejects. This patch fixes the issue partially, only when the message is not encoded in BASE64 nor Quoted-Printable.
Like I said, I would be happy if Tommy took care of that patch.
I dunno. Is it likely to happen? I'd take a look at it myself when I have a chance.
Quoted 8 lines
Quoted 4 lines
* js/ignore-submodule (Wed May 14 18:03:59 2008 +0100) 3 commits
+ Ignore dirty submodule states during rebase and stash
+ Teach update-index about --ignore-submodules
+ diff options: Introduce --ignore-submodulesI haven't heard back from you about renaming that option. I think I suggested --non-gitlinks or something equally discouraging for porcelain users.
The name is fine. I had more trouble with what it does, rather, what it doesn't --- it does not ignore typechange that involve a gitlink if I recall correctly.
Quoted 13 lines
Quoted 4 lines
* db/clone-in-c (Tue May 20 14:15:14 2008 -0400) 11 commits
+ clone: fall back to copying if hardlinking fails
+builtin-clone.c: Need toclosedir()incopy_or_link_directory()
+ builtin-clone: fix initial checkoutQuoted 8 lines
+ Build in clone
+ Provide API access toinit_db()
+ Add a function to set a non-default work tree
+ Allow for havingfor_each_ref()list extra refs
+ Have a constant extern refspec for "--tags"
+ Add a library function to add an alternate to the alternates file
+ Add a lockfile function to append to a file
+ Mark the list of refs to fetch as const
Quoted 1 line
Fingers crossed.
Rather, uncross them and type a few more tests ;-)?
Quoted 13 lines · Junio C Hamano
Quoted 13 lines
Quoted 12 lines
* db/clone-in-c (Tue May 20 14:15:14 2008 -0400) 11 commits
+ clone: fall back to copying if hardlinking fails
+builtin-clone.c: Need toclosedir()incopy_or_link_directory()
+ builtin-clone: fix initial checkout
+ Build in clone
+ Provide API access toinit_db()
+ Add a function to set a non-default work tree
+ Allow for havingfor_each_ref()list extra refs
+ Have a constant extern refspec for "--tags"
+ Add a library function to add an alternate to the alternates file
+ Add a lockfile function to append to a file
+ Mark the list of refs to fetch as const
Quoted 3 lines
Quoted 1 line
Fingers crossed.
Rather, uncross them and type a few more tests ;-)?
There are a few tests from Johan that didn't get in, which I'd had in my tree but didn't send because I don't have a good process in place for sending patches I'm not the author of. I'm pretty sure they pass, but I haven't checked recently. I'll send them in a moment.
-Daniel
*This .sig left intentionally blank*
Quoted 10 lines · Junio C Hamano
[Dropped]
* ap/svn (Tue Apr 15 21:04:18 2008 -0400) 3 commits . git-svn: add documentation for --add-author-from option. . git-svn: Add --add-author-from option.
. git-svn: add documentation for --use-log-author option.Eric requested a new set of tests for this series which never came. I am still holding onto the tip of the topic in case we can resurrect it, but it is not merged to 'pu'.
I usually try hard not to do this kind of thing as it would encourage a misconception that I'll tie any and all loose ends (which I obviously do not have infinite amount of time and energy that is necessary), but I've decided to add a skeleton for necessary tests to get the ball rolling.
Here is a sample output from the test sequence (the log message from the last one):
commit 0bc699cbd72810f85a0200c7197022b50e8298ed
Author: A U Thor <[email protected]>
Date: Mon May 12 21:28:26 2008 +0000
fourth
From: A U Thor <[email protected]>
git-svn-id: file:///git.git/t/trash directory/svnrepo@4 23bf1e2a-19bf-478a-b023-e66a9e40421eI am not sure if adding the "From: " line as a trailer, with two blank line after it before the git-svn-id line, is the intended format for the final log message. Maybe it is meant to go before the commit log message with a blank line after it. Maybe it is meant to be a trailer, one blank line before and after it and then git-svn-id line (in whcih case we have one blank after it too many). I genuinely do not know what is intended.
If this is the intended output, please say so. Otherwise please fix it as needed, and add tests for the final format specification as well, so that later changes will not break it.
Thanks.
-- >8 --
From: Junio C Hamano <[email protected]>
Date: Mon, 12 May 2008 14:53:40 -0700
Subject: [PATCH] git-svn: add test for --add-author-from and --use-log-author
--- t/t9122-git-svn-author.sh | 73 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-) create mode 100755 t/t9122-git-svn-author.sh
t/t9122-git-svn-author.sh new file +73 -0
@@ -0,0 +1,73 @@ +#!/bin/sh + +test_description='git svn authorship' +. ./lib-git-svn.sh + +test_expect_success 'setup svn repository' ' + svn checkout "$svnrepo" work.svn && + ( + cd work.svn && + echo >file + svn add file + svn commit -m "first commit" file + ) + +' + +test_expect_success 'interact with it via git-svn' ' + + mkdir work.git && + ( + cd work.git && + git svn init "$svnrepo" + git svn fetch && + + echo modification >file && + test_tick && + git commit -a -m second && + + test_tick && + git svn dcommit && + + echo "further modification" >file && + test_tick && + git commit -a -m third && + + test_tick && + git svn --add-author-from dcommit && + + echo "yet further modification" >file && + test_tick && + git commit -a -m fourth && + + test_tick && + git svn --add-author-from --use-log-author dcommit && + + git log && + + git show -s HEAD^^ >../actual.2 && + git show -s HEAD^ >../actual.3 && + git show -s HEAD >../actual.4 + + ) && + + # Make sure that --add-author-from without --use-log-author + # did not affect the authorship information + myself=$(grep "^Author: " actual.2) && + unaffected=$(grep "^Author: " actual.3) && + test "z$myself" = "z$unaffected" && + + # Make sure lack of --add-author-from did not add cruft + ! grep "^ From: A U Thor " actual.2 && + + # Make sure --add-author-from added cruft + grep "^ From: A U Thor " actual.3 && + grep "^ From: A U Thor " actual.4 && + + # Make sure --add-author-from with --use-log-author affected + # the authorship information + grep "^Author: A U Thor " actual.4 + +' + +test_done
Signature · 1 line
1.5.5.1.328.g8abfd
Adam, I am very sorry, but the message was misdirected.
I'm resending it now to ask for comments from Avery.