* Re: [PATCH 0/4] Simplify and document strbuf_split() functions
From: Jeff King @ 2012-11-04 11:50 UTC (permalink / raw)
To: Michael Haggerty; +Cc: Junio C Hamano, git
In-Reply-To: <1352011614-29334-1-git-send-email-mhagger@alum.mit.edu>
On Sun, Nov 04, 2012 at 07:46:50AM +0100, Michael Haggerty wrote:
> The strbuf_split() family of functions was completely undocumented.
> Add documentation and also simplify the definition of
> strbuf_split_buf().
Thanks. Looks good overall, even with the comments I raised for patch 1
(I think it is not a big deal, and even if it does become a big deal,
the right fix is probably to make alloc_nr smarter about early growth).
-Peff
^ permalink raw reply
* Re: [PATCH 5/5] string_list_add_refs_from_colon_sep(): use string_list_split()
From: Jeff King @ 2012-11-04 11:57 UTC (permalink / raw)
To: Michael Haggerty; +Cc: Junio C Hamano, git
In-Reply-To: <1352012830-13591-6-git-send-email-mhagger@alum.mit.edu>
On Sun, Nov 04, 2012 at 08:07:10AM +0100, Michael Haggerty wrote:
> It makes for simpler code than strbuf_split().
Agreed.
I wonder how useful the strbuf_split functions really are. Callers might
care about splitting content in a strbuf, but in general, getting a list
of strbufs out is just a hassle, and a string_list makes more sense.
It's probably not worth spending time converting them unless we happen
to be working in the area, though.
-Peff
^ permalink raw reply
* Re: What's cooking in git.git (Oct 2012, #09; Mon, 29)
From: Jeff King @ 2012-11-04 12:29 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Chris Rorvick, git
In-Reply-To: <50943C1A.4090706@ramsay1.demon.co.uk>
On Fri, Nov 02, 2012 at 09:33:14PM +0000, Ramsay Jones wrote:
> >> I wonder if Ramsay has an older perl that does not do this special
> >> hackery right. I'll see if I can dig up where it first appeared.
>
> Hmm, sorry for not specifying this upfront, but this failure is on Linux. ;-)
Ah, that's helpful to know.
> (Linux is my main platform, but I like to keep cygwin working because it has
> kept me sane on Windows ever since (about) 1995 ...)
> "Stranger in a strange land" ;-)
I used a different trick around the same time to keep me sane from
Windows, but I think it involved "dd" and "/dev/zero"...
> I'm using perl v5.8.8 on Linux.
Yeah, that is the problem. Calling localtime_r repeatedly while changing
the timezone does not work on some platforms:
https://rt.perl.org/rt3/Public/Bug/Display.html?id=26136
The fix (to call tzset each time) went into perl 5.10.0.
> > Ramsay, what happens with this patch on top?
>
> This patch fixes the test for me.
Great. I was guessing blindly when I wrote it, but having seen the perl
bug above, it all makes sense.
We should probably wrap it. I'm planning to queue this on top of Chris's
patch:
-- >8 --
Subject: [PATCH] cvsimport: work around perl tzset issue
On many platforms, the first invocation of localtime_r will
check $TZ in the environment, but subsequent invocations
will use a cache value. That means that setting $ENV{TZ} in
the middle of the program may or may not have an effect on
later calls to localtime. Perl 5.10.0 and later handles
this automatically for us, but we try to remain portable
back to 5.8. Work around it by calling tzset ourselves.
Signed-off-by: Jeff King <peff@peff.net>
---
git-cvsimport.perl | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index ceb119d..0a31ebd 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -24,11 +24,11 @@ use File::Basename qw(basename dirname);
use Time::Local;
use IO::Socket;
use IO::Pipe;
-use POSIX qw(strftime dup2 ENOENT);
+use POSIX qw(strftime tzset dup2 ENOENT);
use IPC::Open2;
$SIG{'PIPE'}="IGNORE";
-$ENV{'TZ'}="UTC";
+set_timezone('UTC');
our ($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,@opt_M,$opt_A,$opt_S,$opt_L, $opt_a, $opt_r, $opt_R);
my (%conv_author_name, %conv_author_email, %conv_author_tz);
@@ -99,6 +99,15 @@ sub write_author_info($) {
close ($f);
}
+# Versions of perl before 5.10.0 may not automatically check $TZ each
+# time localtime is run (most platforms will do so only the first time).
+# We can work around this by using tzset() to update the internal
+# variable whenever we change the environment.
+sub set_timezone {
+ $ENV{TZ} = shift;
+ tzset();
+}
+
# convert getopts specs for use by git config
my %longmap = (
'A:' => 'authors-file',
@@ -854,9 +863,9 @@ sub commit {
}
}
- $ENV{'TZ'}=$author_tz;
+ set_timezone($author_tz);
my $commit_date = strftime("%s %z", localtime($date));
- $ENV{'TZ'}="UTC";
+ set_timezone('UTC');
$ENV{GIT_AUTHOR_NAME} = $author_name;
$ENV{GIT_AUTHOR_EMAIL} = $author_email;
$ENV{GIT_AUTHOR_DATE} = $commit_date;
--
1.8.0.207.gdf2154c
^ permalink raw reply related
* Re: [msysGit] Re: Git for Windows and line endings
From: Raja R Harinath @ 2012-11-04 12:37 UTC (permalink / raw)
To: git; +Cc: msysgit
In-Reply-To: <CADKp0pxuFsSEeZoeemyaqhSJEcsjj1arEOsF4Ub8=76y7tkwHg@mail.gmail.com>
Hi,
Chris B <chris.blaszczynski@gmail.com> writes:
[snip]
> - Windows has been able to cope with UNIX line endings a long time; no
> developer is using a default Notepad to open files with high
> expectations. Any Windows development tool and editor worth anything
> I've used is able to handle both just fine.
> - VIM also handles Windows line endings just fine as well. I just
> tested it on a Linux machine. Maybe old version? (pure VI is not even
> on this machine but hard to press these days it can't handle it.)
> - The files in .git folder are in UNIX format anyway, so why are those
> not also included in line ending changes? Isn't is because there is a
> Windows app (msysgit) running on Windows that expects the UNIX line
> ending? So in the same manor, someone might have a Windows system
> using some Cygwin components perhaps, or a Windows C program possibly
> poorly written or just old, that demand some text files to be left
> alone in the format we saved it.
There are several subtleties in LF handling with mixed systems. Here's
my write-up in:
https://github.com/mono/mono/blob/master/.gitattributes
for an example set of trade-offs. Quoting in full since it's fairly short.
- Hari
# CRLF Handling
# -------------
#
# The ideal situation would be to do no EOL normalization. Each file
# would have a default EOL, and tools on Windows and Linux would handle
# both EOL formats.
#
# We're not in the ideal world. A popular editor on Windows (possibly
# Visual Studio) silently introduces EOL corruption -- it displays an
# LF-file normally, but any newly added lines have CRLF. On Linux,
# Emacs and versions of VI handle LF-files and CRLF-files properly.
# However, emacs doesn't like files with both LF and CRLF EOLs. Editing
# the file without additional action will increase the EOL corruption
# in the file.
#
# Another vector for mixed EOLs is scripts. We mostly don't have scripts
# that add new lines -- so we rarely see this. However, one major event
# in the tree was the addition of copyright headers using a script. That
# script introduced EOL corruption.
#
# Any automated EOL normalization of files already in the repository will
# cause difficulties in traversing histories, assigning blame, etc. So, we
# don't want to change what's in the repository significantly, even if it
# causes trouble.
#
# What we do now:
#
# a) we ensure that there's no further corruption of LF-files. So, we use
# git's 'crlf' attribute on those files to ensure that things are fine
# when we work on Windows. We could use 'crlf=input', but it doesn't buy
# us much -- we might as well be working with consistent EOLs for files in
# working directories as well as in the repository
#
# b) if the file already of CRLFs, we don't do any normalization. We use '-crlf'
# so that git doesn't do any EOL-conversion of the file. As I said, this
# is mostly harmless on Linux. We can't mark these files as 'crlf' or use
# the new (git 1.7.2) 'eol=crlf' attribute, since it changes the contents
# _inside_ the repository [1], and hence makes history traversal annoying.
# So, we live with occasional EOL corruption.
#
# c) We can handle mixed-EOL files on a case-by-case basis, converting them to
# LF- or CRLF-files based on which causes fewer lines to change
#
# d) We try to ensure no further headaches, by declaring EOL normalization on
# code files, and Unix-flavoured files, like shell-scripts, makefiles, etc.
#
# [1] GIT use LFs as the normalized internal representation.
^ permalink raw reply
* Re: [PATCH] Add rm to submodule command.
From: Jeff King @ 2012-11-04 13:43 UTC (permalink / raw)
To: Alex Linden Levy; +Cc: Jens Lehmann, gitster, git
In-Reply-To: <1351877171-3176-1-git-send-email-lindenle@gmail.com>
On Fri, Nov 02, 2012 at 10:26:11AM -0700, Alex Linden Levy wrote:
> This change removes the config entries in .gitmodules and adds it.
> ---
Signoff?
> git-submodule.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 61 insertions(+), 1 deletion(-)
No documentation or tests?
> diff --git a/git-submodule.sh b/git-submodule.sh
> index ab6b110..29d950f 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
I'd defer to submodule experts on whether the steps to 'rm' the
submodule make sense. Jens?
-Peff
^ permalink raw reply
* Re: [PATCH] gitweb.perl: fix %highlight_ext
From: Jeff King @ 2012-11-04 13:45 UTC (permalink / raw)
To: rh; +Cc: git
In-Reply-To: <20121102141809.caf5cbc07f08769fd6a302ad@lavabit.com>
On Fri, Nov 02, 2012 at 02:18:09PM -0700, rh wrote:
> > I think the patch itself looks OK, but:
> >
> > 1. It isn't formatted to apply with git-am. Please use
> > git-format-patch.
>
> git format-patch command wouldn't work for me. I can see that you
> don't need more stuff to do but not knowing git I couldn't find the
> correct incantation to do this part. A problem with the files not
> being in a git repo I think. I'll spare you details.
The usual procedure is:
1. hack hack hack
2. git commit
3. git format-patch
And if you are not in a git repo, step 0 is "git init". :)
-Peff
^ permalink raw reply
* Re: [PATCH] gitweb.perl: fix %highlight_ext mappings
From: Jeff King @ 2012-11-04 13:48 UTC (permalink / raw)
To: rh; +Cc: git
In-Reply-To: <20121102141226.643a96e61b8bf383428c5287@lavabit.com>
On Fri, Nov 02, 2012 at 02:12:26PM -0700, rh wrote:
> The previous change created a dictionary of one-to-one elements when
> the intent was to map mutliple related types to one main type.
> e.g. bash, ksh, zsh, sh all map to sh since they share similar syntax
> This makes the mapping as the original change intended.
>
> Signed-off-by: rh <richard_hubbe11@lavabit.com>
>
> diff --git a/gitweb.cgi.orig b/gitweb.cgi
> index 060db27..155b238 100755
> --- a/gitweb.cgi.orig
> +++ b/gitweb.cgi
Close on the format. There should be a "---" after the sign-off but
before the diff. I can fix it up locally (and the patch looks good to
me).
However, one final thing: the point of the sign-off is to indicate that
you are legally OK to release the code under the DCO. For that reason,
we usually require a real name (not rh). I can guess at your real name
from your email, but I'd rather be sure. Can you provide it?
-Peff
^ permalink raw reply
* Re: [PATCH] Add rm to submodule command.
From: Jens Lehmann @ 2012-11-04 14:29 UTC (permalink / raw)
To: Jeff King; +Cc: Alex Linden Levy, gitster, git, Heiko Voigt
In-Reply-To: <20121104134324.GA31623@sigill.intra.peff.net>
Am 04.11.2012 14:43, schrieb Jeff King:
> On Fri, Nov 02, 2012 at 10:26:11AM -0700, Alex Linden Levy wrote:
>
>> This change removes the config entries in .gitmodules and adds it.
>> ---
>
> Signoff?
>
>> git-submodule.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>> 1 file changed, 61 insertions(+), 1 deletion(-)
>
> No documentation or tests?
>
>> diff --git a/git-submodule.sh b/git-submodule.sh
>> index ab6b110..29d950f 100755
>> --- a/git-submodule.sh
>> +++ b/git-submodule.sh
>
> I'd defer to submodule experts on whether the steps to 'rm' the
> submodule make sense. Jens?
Hmm, this change adds the --quiet and --branch options to rm
which aren't used (and at least --branch makes no sense to me
here). Remainders of copy & paste? It also only affects the
.gitmodules setting and leaves the submodules work tree alone,
while I think it should - at least optionally - remove the work
tree just like "git rm" removes files too (of course only if
there is no .git directory found in it and no modifications are
present, as that would possibly lose data).
Me also thinks such a command should use my recent rm submodule
work to remove the work tree (found in your current master and
Junio's next branch), which does all necessary checks before it
removes the work tree together with the index entry. This could
be tweaked via a --cached option or such if the user wants to
keep the work tree.
But apart from those issues I'm not convinced that adding a
"git submodule rm" command is the best option. While working on
teaching "git mv" to move submodules I came to the conclusion
that it might be a better solution to let "git rm" remove the
submodule entry from the .gitmodules file itself (but of course
only if that file is found and contains such an entry, if not
it will silently do nothing to not disturb submodule users who
don't have a .gitmodules file and are using plain gitlinks).
The reason is that git core commands like status, diff and
fetch already use the path -> name mapping found in .gitmodules
and will behave strange when this is out of sync with the work
tree. So I strongly believe that doing a "git mv" should change
the path -> name mapping in .gitmodules too while moving the
submodule's work tree and updating the index (of course again
only if .gitmodules is found and contains such an entry, if not
it'll just move the work tree and update the index). Then we
won't need a new "git submodule mv" command as everything is
done inside the mv command. And for consistency I think "git rm"
should also remove the path -> name mapping (even though that is
not required for a rm to do its job, as no one will use that
setting later when the submodule is gone from the index). Then
we won't need a new "git submodule rm" at all.
Does that make sense?
^ permalink raw reply
* git-archive submodule support
From: Rotem Yaari @ 2012-11-04 14:53 UTC (permalink / raw)
To: git
Hi,
I was wondering if there are any plans to support inclusion of
submodules in git-archive. This is very useful for quickly preparing
ready-to-deploy archives of "unstable" branches etc., without the
users' need to clone submodule dependencies each time.
Is this planned at some point? Such a change would be greatly appreciated.
Thanks,
--
Rotem
^ permalink raw reply
* What's cooking in git.git (Nov 2012, #01; Sun, 4)
From: Jeff King @ 2012-11-04 14:56 UTC (permalink / raw)
To: git
What's cooking in git.git (Nov 2012, #01; Sun, 4)
--------------------------------------------------
Here are the topics that have been cooking. Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'.
The third batch of topics has graduated to master.
You can find the changes described here in the integration branches of
my repository at:
git://github.com/peff/git.git
Until Junio returns, kernel.org and the other "usual" places will not be
updated.
--------------------------------------------------
[New Topics]
* as/maint-doc-fix-no-post-rewrite (2012-11-02) 1 commit
- commit: fixup misplacement of --no-post-rewrite description
Will merge to 'next'.
* fc/remote-bzr (2012-11-04) 3 commits
- remote-bzr: add simple tests
- remote-bzr: add support for pushing
- Add new remote-bzr transport helper
New remote helper for bzr.
* fc/remote-hg (2012-11-04) 16 commits
- remote-hg: the author email can be null
- remote-hg: add option to not track branches
- remote-hg: add extra author test
- remote-hg: add tests to compare with hg-git
- remote-hg: add bidirectional tests
- test-lib: avoid full path to store test results
- remote-hg: add basic tests
- remote-hg: fake bookmark when there's none
- remote-hg: add compat for hg-git author fixes
- remote-hg: add support for hg-git compat mode
- remote-hg: match hg merge behavior
- remote-hg: make sure the encoding is correct
- remote-hg: add support to push URLs
- remote-hg: add support for remote pushing
- remote-hg: add support for pushing
- Add new remote-hg transport helper
New remote helper for hg.
May want to do one more round of review on the list.
Most of the discussion so far has been on whether to pursue this versus
what's in msysgit, and not on the specifics of the code. I'd like to
put this in next soon, but it probably makes sense for everybody to
give it a final look-over.
* jk/maint-http-half-auth-fetch (2012-10-31) 2 commits
- remote-curl: retry failed requests for auth even with gzip
- remote-curl: hoist gzip buffer size to top of post_rpc
Fixes fetch from servers that ask for auth only during the actual
packing phase. This is not really a recommended configuration, but it
cleans up the code at the same time.
Will merge to 'next'.
* js/hp-nonstop (2012-10-30) 1 commit
- fix 'make test' for HP NonStop
Will merge to 'next'.
* kb/preload-index-more (2012-11-02) 1 commit
- update-index/diff-index: use core.preloadindex to improve performance
Use preloadindex in more places, which has a nice speedup on systems
with slow stat calls (and even on Linux).
Will merge to 'next'.
* mh/notes-string-list (2012-11-04) 5 commits
- string_list_add_refs_from_colon_sep(): use string_list_split()
- notes: fix handling of colon-separated values
- combine_notes_cat_sort_uniq(): sort and dedup lines all at once
- Initialize sort_uniq_list using named constant
- string_list: add a function string_list_remove_empty_items()
Improve the asymptotic performance of the cat_sort_uniq notes merge
strategy.
Will merge to 'next'.
* mh/strbuf-split (2012-11-04) 4 commits
- strbuf_split*(): document functions
- strbuf_split*(): rename "delim" parameter to "terminator"
- strbuf_split_buf(): simplify iteration
- strbuf_split_buf(): use ALLOC_GROW()
Cleanups and documentation for strbuf_split.
Will merge to 'next'.
* mm/maint-doc-commit-edit (2012-11-02) 1 commit
- Document 'git commit --no-edit' explicitly
Will merge to 'next'.
--------------------------------------------------
[Graduated to "master"]
* gb/maint-doc-svn-log-window-size (2012-10-26) 1 commit
(merged to 'next' on 2012-10-29 at ee50b22)
+ Document git-svn fetch --log-window-size parameter
Will merge to 'master' in the third batch.
* km/maint-doc-git-reset (2012-10-29) 1 commit
(merged to 'next' on 2012-10-29 at cdb4e8f)
+ doc: git-reset: make "<mode>" optional
Will merge to 'master' in the third batch.
* mm/maint-doc-remote-tracking (2012-10-25) 1 commit
(merged to 'next' on 2012-10-25 at 80f1592)
+ Documentation: remote tracking branch -> remote-tracking branch
We long ago hyphenated "remote-tracking branch"; this
catches some new instances added since then.
Will merge to 'master' in the third batch.
* ph/pull-rebase-detached (2012-10-25) 1 commit
(merged to 'next' on 2012-10-25 at 73d9d14)
+ git-pull: Avoid merge-base on detached head
Avoids spewing error messages when using "pull --rebase" on a
detached HEAD.
Will merge to 'master' in the third batch.
* po/maint-refs-replace-docs (2012-10-25) 1 commit
(merged to 'next' on 2012-10-25 at 3874c9d)
+ Doc repository-layout: Show refs/replace
The refs/replace hierarchy was not mentioned in the
repository-layout docs.
Will merge to 'master' in the third batch.
* pp/maint-doc-pager-config (2012-10-29) 1 commit
(merged to 'next' on 2012-10-29 at 434fbd0)
+ Documentation: improve the example of overriding LESS via core.pager
Will merge to 'master' in the third batch.
* rf/maint-mailmap-off-by-one (2012-10-28) 1 commit
(merged to 'next' on 2012-10-29 at 8c2214b)
+ mailmap: avoid out-of-bounds memory access
Will merge to 'master' in the third batch.
* sl/maint-configure-messages (2012-10-25) 1 commit
(merged to 'next' on 2012-10-25 at e1d7ecd)
+ configure: fix some output message
Minor message fixes for the configure script.
Will merge to 'master' in the third batch.
* sz/maint-submodule-reference-arg (2012-10-26) 1 commit
(merged to 'next' on 2012-10-29 at 1aab03c)
+ submodule add: fix handling of --reference=<repo> option
Will merge to 'master' in the third batch.
* tb/maint-t9200-case-insensitive (2012-10-28) 1 commit
(merged to 'next' on 2012-10-29 at 62af90c)
+ Fix t9200 on case insensitive file systems
Will merge to 'master' in the third batch.
* tj/maint-doc-commit-sign (2012-10-29) 1 commit
(merged to 'next' on 2012-10-29 at 44c61a0)
+ Add -S, --gpg-sign option to manpage of "git commit"
Will merge to 'master' in the third batch.
--------------------------------------------------
[Stalled]
* rc/maint-complete-git-p4 (2012-09-24) 1 commit
(merged to 'next' on 2012-10-29 at af52cef)
+ Teach git-completion about git p4
Comment from Pete will need to be addressed in a follow-up patch.
* as/test-tweaks (2012-09-20) 7 commits
- tests: paint unexpectedly fixed known breakages in bold red
- tests: test the test framework more thoroughly
- [SQUASH] t/t0000-basic.sh: quoting of TEST_DIRECTORY is screwed up
- tests: refactor mechanics of testing in a sub test-lib
- tests: paint skipped tests in bold blue
- tests: test number comes first in 'not ok $count - $message'
- tests: paint known breakages in bold yellow
Various minor tweaks to the test framework to paint its output
lines in colors that match what they mean better.
Has the "is this really blue?" issue Peff raised resolved???
* jc/maint-name-rev (2012-09-17) 7 commits
- describe --contains: use "name-rev --algorithm=weight"
- name-rev --algorithm=weight: tests and documentation
- name-rev --algorithm=weight: cache the computed weight in notes
- name-rev --algorithm=weight: trivial optimization
- name-rev: --algorithm option
- name_rev: clarify the logic to assign a new tip-name to a commit
- name-rev: lose unnecessary typedef
"git name-rev" names the given revision based on a ref that can be
reached in the smallest number of steps from the rev, but that is
not useful when the caller wants to know which tag is the oldest one
that contains the rev. This teaches a new mode to the command that
uses the oldest ref among those which contain the rev.
I am not sure if this is worth it; for one thing, even with the help
from notes-cache, it seems to make the "describe --contains" even
slower. Also the command will be unusably slow for a user who does
not have a write access (hence unable to create or update the
notes-cache).
Stalled mostly due to lack of responses.
* jc/xprm-generation (2012-09-14) 1 commit
- test-generation: compute generation numbers and clock skews
A toy to analyze how bad the clock skews are in histories of real
world projects.
Stalled mostly due to lack of responses.
* jc/blame-no-follow (2012-09-21) 2 commits
- blame: pay attention to --no-follow
- diff: accept --no-follow option
Teaches "--no-follow" option to "git blame" to disable its
whole-file rename detection.
Stalled mostly due to lack of responses.
* jc/doc-default-format (2012-10-07) 2 commits
- [SQAUSH] allow "cd Doc* && make DEFAULT_DOC_TARGET=..."
- Allow generating a non-default set of documentation
Need to address the installation half if this is to be any useful.
* mk/maint-graph-infinity-loop (2012-09-25) 1 commit
- graph.c: infinite loop in git whatchanged --graph -m
The --graph code fell into infinite loop when asked to do what the
code did not expect ;-)
Anybody who worked on "--graph" wants to comment?
Stalled mostly due to lack of responses.
* jc/add-delete-default (2012-08-13) 1 commit
- git add: notice removal of tracked paths by default
"git add dir/" updated modified files and added new files, but does
not notice removed files, which may be "Huh?" to some users. They
can of course use "git add -A dir/", but why should they?
Resurrected from graveyard, as I thought it was a worthwhile thing
to do in the longer term.
Waiting for comments.
* mb/remote-default-nn-origin (2012-07-11) 6 commits
- Teach get_default_remote to respect remote.default.
- Test that plain "git fetch" uses remote.default when on a detached HEAD.
- Teach clone to set remote.default.
- Teach "git remote" about remote.default.
- Teach remote.c about the remote.default configuration setting.
- Rename remote.c's default_remote_name static variables.
When the user does not specify what remote to interact with, we
often attempt to use 'origin'. This can now be customized via a
configuration variable.
Expecting a reroll.
"The first remote becomes the default" bit is better done as a
separate step.
--------------------------------------------------
[Cooking]
* mh/ceiling (2012-10-29) 8 commits
- string_list_longest_prefix(): remove function
- setup_git_directory_gently_1(): resolve symlinks in ceiling paths
- longest_ancestor_length(): require prefix list entries to be normalized
- longest_ancestor_length(): take a string_list argument for prefixes
- longest_ancestor_length(): use string_list_split()
- Introduce new function real_path_if_valid()
- real_path_internal(): add comment explaining use of cwd
- Introduce new static function real_path_internal()
Elements of GIT_CEILING_DIRECTORIES list may not match the real
pathname we obtain from getcwd(), leading the GIT_DIR discovery
logic to escape the ceilings the user thought to have specified.
Need to look at v4 which made it to the list.
* mo/cvs-server-cleanup (2012-10-26) 11 commits
(merged to 'next' on 2012-10-29 at 4e70622)
+ Use character class for sed expression instead of \s
(merged to 'next' on 2012-10-25 at c70881d)
+ cvsserver status: provide real sticky info
+ cvsserver: cvs add: do not expand directory arguments
+ cvsserver: use whole CVS rev number in-process; don't strip "1." prefix
+ cvsserver: split up long lines in req_{status,diff,log}
+ cvsserver: clean up client request handler map comments
+ cvsserver: remove unused functions _headrev and gethistory
+ cvsserver update: comment about how we shouldn't remove a user-modified file
+ cvsserver: add comments about database schema/usage
+ cvsserver: removed unused sha1Or-k mode from kopts_from_path
+ cvsserver t9400: add basic 'cvs log' test
(this branch is tangled with mo/cvs-server-updates.)
Cleanups to prepare for mo/cvs-server-updates.
Will merge to 'master' in the fourth batch.
* mo/cvs-server-updates (2012-10-16) 20 commits
- cvsserver Documentation: new cvs ... -r support
- cvsserver: add t9402 to test branch and tag refs
- cvsserver: support -r and sticky tags for most operations
- cvsserver: Add version awareness to argsfromdir
- cvsserver: generalize getmeta() to recognize commit refs
- cvsserver: implement req_Sticky and related utilities
- cvsserver: add misc commit lookup, file meta data, and file listing functions
- cvsserver: define a tag name character escape mechanism
- cvsserver: cleanup extra slashes in filename arguments
- cvsserver: factor out git-log parsing logic
(merged to 'next' on 2012-10-25 at c70881d)
+ cvsserver status: provide real sticky info
+ cvsserver: cvs add: do not expand directory arguments
+ cvsserver: use whole CVS rev number in-process; don't strip "1." prefix
+ cvsserver: split up long lines in req_{status,diff,log}
+ cvsserver: clean up client request handler map comments
+ cvsserver: remove unused functions _headrev and gethistory
+ cvsserver update: comment about how we shouldn't remove a user-modified file
+ cvsserver: add comments about database schema/usage
+ cvsserver: removed unused sha1Or-k mode from kopts_from_path
+ cvsserver t9400: add basic 'cvs log' test
(this branch is tangled with mo/cvs-server-cleanup.)
Needs review by folks interested in cvsserver.
* ta/doc-cleanup (2012-10-25) 6 commits
- Documentation: build html for all files in technical and howto
- Documentation/howto: convert plain text files to asciidoc
- Documentation/technical: convert plain text files to asciidoc
- Change headline of technical/send-pack-pipeline.txt to not confuse its content with content from git-send-pack.txt
- Shorten two over-long lines in git-bisect-lk2009.txt by abbreviating some sha1
- Split over-long synopsis in git-fetch-pack.txt into several lines
Misapplication of a patch fixed; the ones near the tip needs to
update the links to point at the html files, though.
Needs follow-up on Junio's comment above.
* lt/diff-stat-show-0-lines (2012-10-17) 1 commit
- Fix "git diff --stat" for interesting - but empty - file changes
We failed to mention a file without any content change but whose
permission bit was modified, or (worse yet) a new file without any
content in the "git diff --stat" output.
Needs some test updates.
* jc/prettier-pretty-note (2012-10-26) 11 commits
(merged to 'next' on 2012-11-04 at 40e3e48)
+ Doc User-Manual: Patch cover letter, three dashes, and --notes
+ Doc format-patch: clarify --notes use case
+ Doc notes: Include the format-patch --notes option
+ Doc SubmittingPatches: Mention --notes option after "cover letter"
+ Documentation: decribe format-patch --notes
+ format-patch --notes: show notes after three-dashes
+ format-patch: append --signature after notes
+ pretty_print_commit(): do not append notes message
+ pretty: prepare notes message at a centralized place
+ format_note(): simplify API
+ pretty: remove reencode_commit_message()
Now that Philip has submitted some documentation updates, this is
looking more ready.
Will merge to master in the fifth batch.
* sz/maint-curl-multi-timeout (2012-10-19) 1 commit
(merged to 'next' on 2012-11-04 at f696dd8)
+ Fix potential hang in https handshake
Sometimes curl_multi_timeout() function suggested a wrong timeout
value when there is no file descriptors to wait on and the http
transport ended up sleeping for minutes in select(2) system call.
Detect this and reduce the wait timeout in such a case.
Will merge to master in the fourth batch.
* jc/same-encoding (2012-11-04) 1 commit
(merged to 'next' on 2012-11-04 at 54991f2)
+ reencode_string(): introduce and use same_encoding()
Various codepaths checked if two encoding names are the same using
ad-hoc code and some of them ended up asking iconv() to convert
between "utf8" and "UTF-8". The former is not a valid way to spell
the encoding name, but often people use it by mistake, and we
equated them in some but not all codepaths. Introduce a new helper
function to make these codepaths consistent.
will merge to master in the fourth batch.
* nd/tree-walk-enum-cleanup (2012-10-19) 1 commit
(merged to 'next' on 2012-11-04 at 8ccdf98)
+ tree-walk: use enum interesting instead of integer
Will merge to master in the fourth batch.
* cr/cvsimport-local-zone (2012-11-04) 2 commits
(merged to 'next' on 2012-11-04 at 292f0b4)
+ cvsimport: work around perl tzset issue
+ git-cvsimport: allow author-specific timezones
Allows "cvsimport" to read per-author timezone from the author info
file.
Will merge to master in the fifth batch.
* fc/completion-send-email-with-format-patch (2012-10-16) 1 commit
(merged to 'next' on 2012-11-04 at 0a6366e)
+ completion: add format-patch options to send-email
Will merge to master in the fourth batch.
* fc/zsh-completion (2012-10-29) 3 commits
- completion: add new zsh completion
- completion: add new __gitcompadd helper
- completion: get rid of empty COMPREPLY assignments
Needs comments from completion folks.
* jc/apply-trailing-blank-removal (2012-10-12) 1 commit
- apply.c:update_pre_post_images(): the preimage can be truncated
Fix to update_pre_post_images() that did not take into account the
possibility that whitespace fix could shrink the preimage and
change the number of lines in it.
Extra set of eyeballs appreciated.
* jn/warn-on-inaccessible-loosen (2012-10-14) 4 commits
- config: exit on error accessing any config file
- doc: advertise GIT_CONFIG_NOSYSTEM
- config: treat user and xdg config permission problems as errors
- config, gitignore: failure to access with ENOTDIR is ok
An RFC to deal with a situation where .config/git is a file and we
notice .config/git/config is not readable due to ENOTDIR, not
ENOENT; I think a bit more refactored approach to consistently
address permission errors across config, exclude and attrs is
desirable. Don't we also need a check for an opposite situation
where we open .config/git/config or .gitattributes for reading but
they turn out to be directories?
* rs/lock-correct-ref-during-delete (2012-10-16) 1 commit
(merged to 'next' on 2012-10-25 at 9341eea)
+ refs: lock symref that is to be deleted, not its target
When "update-ref -d --no-deref SYM" tried to delete a symbolic ref
SYM, it incorrectly locked the underlying reference pointed by SYM,
not the symbolic ref itself.
Will merge to 'master' in the fourth batch.
* as/check-ignore (2012-10-29) 13 commits
- Documentation/check-ignore: we show the deciding match, not the first
- Add git-check-ignore sub-command
- dir.c: provide free_directory() for reclaiming dir_struct memory
- pathspec.c: move reusable code from builtin/add.c
- dir.c: refactor treat_gitlinks()
- dir.c: keep track of where patterns came from
- dir.c: refactor is_path_excluded()
- dir.c: refactor is_excluded()
- dir.c: refactor is_excluded_from_list()
- dir.c: rename excluded() to is_excluded()
- dir.c: rename excluded_from_list() to is_excluded_from_list()
- dir.c: rename path_excluded() to is_path_excluded()
- dir.c: rename cryptic 'which' variable to more consistent name
(this branch uses nd/attr-match-optim-more; is tangled with nd/wildmatch.)
Duy helped to reroll this.
Expecting another re-roll.
* js/format-2047 (2012-10-18) 7 commits
(merged to 'next' on 2012-10-25 at 76d91fe)
+ format-patch tests: check quoting/encoding in To: and Cc: headers
+ format-patch: fix rfc2047 address encoding with respect to rfc822 specials
+ format-patch: make rfc2047 encoding more strict
+ format-patch: introduce helper function last_line_length()
+ format-patch: do not wrap rfc2047 encoded headers too late
+ format-patch: do not wrap non-rfc2047 headers too early
+ utf8: fix off-by-one wrapping of text
Fixes many rfc2047 quoting issues in the output from format-patch.
Will merge to 'master' in the fourth batch.
* km/send-email-compose-encoding (2012-10-25) 5 commits
(merged to 'next' on 2012-10-29 at d7d2bb4)
+ git-send-email: add rfc2047 quoting for "=?"
+ git-send-email: introduce quote_subject()
+ git-send-email: skip RFC2047 quoting for ASCII subjects
+ git-send-email: use compose-encoding for Subject
(merged to 'next' on 2012-10-25 at 5447367)
+ git-send-email: introduce compose-encoding
"git send-email --compose" can let the user create a non-ascii
cover letter message, but there was not a way to mark it with
appropriate content type before sending it out.
Further updates fix subject quoting.
Will merge to 'master' in the fourth batch.
* so/prompt-command (2012-10-17) 4 commits
(merged to 'next' on 2012-10-25 at 79565a1)
+ coloured git-prompt: paint detached HEAD marker in red
+ Fix up colored git-prompt
+ show color hints based on state of the git tree
+ Allow __git_ps1 to be used in PROMPT_COMMAND
Updates __git_ps1 so that it can be used as $PROMPT_COMMAND,
instead of being used for command substitution in $PS1, to embed
color escape sequences in its output.
Will 'cook' in next.
* aw/rebase-am-failure-detection (2012-10-11) 1 commit
- rebase: Handle cases where format-patch fails
I am unhappy a bit about the possible performance implications of
having to store the output in a temporary file only for a rare case
of format-patch aborting.
* nd/wildmatch (2012-10-15) 13 commits
(merged to 'next' on 2012-10-25 at 510e8df)
+ Support "**" wildcard in .gitignore and .gitattributes
+ wildmatch: make /**/ match zero or more directories
+ wildmatch: adjust "**" behavior
+ wildmatch: fix case-insensitive matching
+ wildmatch: remove static variable force_lower_case
+ wildmatch: make wildmatch's return value compatible with fnmatch
+ t3070: disable unreliable fnmatch tests
+ Integrate wildmatch to git
+ wildmatch: follow Git's coding convention
+ wildmatch: remove unnecessary functions
+ Import wildmatch from rsync
+ ctype: support iscntrl, ispunct, isxdigit and isprint
+ ctype: make sane_ctype[] const array
(this branch uses nd/attr-match-optim-more; is tangled with as/check-ignore.)
Allows pathname patterns in .gitignore and .gitattributes files
with double-asterisks "foo/**/bar" to match any number of directory
hierarchies.
I suspect that this needs to be plugged to pathspec matching code;
otherwise "git log -- 'Docum*/**/*.txt'" would not show the log for
commits that touch Documentation/git.txt, which would be confusing
to the users.
Will cook in 'next'.
* jk/lua-hackery (2012-10-07) 6 commits
- pretty: fix up one-off format_commit_message calls
- Minimum compilation fixup
- Makefile: make "lua" a bit more configurable
- add a "lua" pretty format
- add basic lua infrastructure
- pretty: make some commit-parsing helpers more public
Interesting exercise. When we do this for real, we probably would want
to wrap a commit to make it more like an "object" with methods like
"parents", etc.
* nd/attr-match-optim-more (2012-10-15) 7 commits
(merged to 'next' on 2012-10-25 at 09f70ce)
+ attr: more matching optimizations from .gitignore
+ gitignore: make pattern parsing code a separate function
+ exclude: split pathname matching code into a separate function
+ exclude: fix a bug in prefix compare optimization
+ exclude: split basename matching code into a separate function
+ exclude: stricten a length check in EXC_FLAG_ENDSWITH case
+ Merge commit 'f9f6e2c' into nd/attr-match-optim-more
(this branch is used by as/check-ignore and nd/wildmatch.)
Start laying the foundation to build the "wildmatch" after we can
agree on its desired semantics.
Will merge to 'master' in the fourth batch.
* nd/pretty-placeholder-with-color-option (2012-09-30) 9 commits
. pretty: support %>> that steal trailing spaces
. pretty: support truncating in %>, %< and %><
. pretty: support padding placeholders, %< %> and %><
. pretty: two phase conversion for non utf-8 commits
. utf8.c: add utf8_strnwidth() with the ability to skip ansi sequences
. utf8.c: move display_mode_esc_sequence_len() for use by other functions
. pretty: support %C(auto[,N]) to turn on coloring on next placeholder(s)
. pretty: split parsing %C into a separate function
. pretty: share code between format_decoration and show_decorations
This causes warnings with -Wuninitialized, so I've ejected it from pu
for the time being.
* jc/maint-fetch-tighten-refname-check (2012-10-19) 1 commit
(merged to 'next' on 2012-11-04 at eda85ef)
+ get_fetch_map(): tighten checks on dest refs
This was split out from discarded jc/maint-push-refs-all topic.
Will merge to master in the fifth batch.
* jh/symbolic-ref-d (2012-10-21) 1 commit
(merged to 'next' on 2012-11-04 at b0762f5)
+ git symbolic-ref --delete $symref
Add "symbolic-ref -d SYM" to delete a symbolic ref SYM.
It is already possible to remove a symbolic ref with "update-ref -d
--no-deref", but it may be a good addition for completeness.
Will merge to master in the fifth batch.
* jh/update-ref-d-through-symref (2012-10-21) 2 commits
- Fix failure to delete a packed ref through a symref
- t1400-update-ref: Add test verifying bug with symrefs in delete_ref()
"update-ref -d --deref SYM" to delete a ref through a symbolic ref
that points to it did not remove it correctly.
* jk/config-ignore-duplicates (2012-10-29) 9 commits
(merged to 'next' on 2012-10-29 at 67fa0a2)
+ builtin/config.c: Fix a sparse warning
(merged to 'next' on 2012-10-25 at 233df08)
+ git-config: use git_config_with_options
+ git-config: do not complain about duplicate entries
+ git-config: collect values instead of immediately printing
+ git-config: fix regexp memory leaks on error conditions
+ git-config: remove memory leak of key regexp
+ t1300: test "git config --get-all" more thoroughly
+ t1300: remove redundant test
+ t1300: style updates
Drop duplicate detection from git-config; this lets it
better match the internal config callbacks, which clears up
some corner cases with includes.
Will cook in 'next'.
* ph/submodule-sync-recursive (2012-10-29) 2 commits
(merged to 'next' on 2012-11-04 at a000f78)
+ Add tests for submodule sync --recursive
+ Teach --recursive to submodule sync
Adds "--recursive" option to submodule sync.
Will merge to master in the fifth batch.
* fc/completion-test-simplification (2012-10-29) 2 commits
- completion: simplify __gitcomp test helper
- completion: refactor __gitcomp related tests
Clean up completion tests.
There were some comments on the list.
Expecting a re-roll.
* fc/remote-testgit-feature-done (2012-10-29) 1 commit
- remote-testgit: properly check for errors
Needs review.
* jk/maint-diff-grep-textconv (2012-10-28) 1 commit
(merged to 'next' on 2012-11-04 at 790337b)
+ diff_grep: use textconv buffers for add/deleted files
(this branch is used by jk/pickaxe-textconv.)
Fixes inconsistent use of textconv with "git log -G".
Will merge to 'master' in the fifth batch.
* jk/pickaxe-textconv (2012-10-28) 2 commits
- pickaxe: use textconv for -S counting
- pickaxe: hoist empty needle check
(this branch uses jk/maint-diff-grep-textconv.)
Use textconv filters when searching with "log -S".
Waiting for a sanity check and review from Junio.
* mh/maint-parse-dirstat-fix (2012-10-29) 1 commit
(merged to 'next' on 2012-11-04 at 852d609)
+ parse_dirstat_params(): use string_list to split comma-separated string
Cleans up some code and avoids a potential bug.
Will merge master in the fourth batch.
* nd/builtin-to-libgit (2012-10-29) 7 commits
(merged to 'next' on 2012-11-04 at 06cbf9b)
+ fetch-pack: move core code to libgit.a
+ fetch-pack: remove global (static) configuration variable "args"
+ send-pack: move core code to libgit.a
+ Move setup_diff_pager to libgit.a
+ Move print_commit_list to libgit.a
+ Move estimate_bisect_steps to libgit.a
+ Move try_merge_command and checkout_fast_forward to libgit.a
Code cleanups so that libgit.a does not depend on anything in the
builtin/ directory.
Some of the code movement is pretty big, but there doesn't seem to be
any conflicts with topics in flight.
Will merge to master in the fourth batch.
* ph/maint-submodule-status-fix (2012-10-29) 2 commits
(merged to 'next' on 2012-11-04 at d700e02)
+ submodule status: remove unused orig_* variables
+ t7407: Fix recursive submodule test
Cleans up some leftover bits from an earlier submodule change.
Will merge to master in the fourth batch.
^ permalink raw reply
* Re: git-archive submodule support
From: Jens Lehmann @ 2012-11-04 16:40 UTC (permalink / raw)
To: Rotem Yaari; +Cc: git
In-Reply-To: <CADyFpa7t_iCr6B8ns8QqkySRXfYtaJ8W0iseHWGz6jv62s_vzQ@mail.gmail.com>
Am 04.11.2012 15:53, schrieb Rotem Yaari:
> I was wondering if there are any plans to support inclusion of
> submodules in git-archive. This is very useful for quickly preparing
> ready-to-deploy archives of "unstable" branches etc., without the
> users' need to clone submodule dependencies each time.
>
> Is this planned at some point? Such a change would be greatly appreciated.
It is planned but I don't expect to find the time for that in the
near future, especially as this is not my itch. But I'd be willing
to assist you in resurrecting a four year old patch for that from
Lars Hjemli. It is archived in my GitHub repo:
https://github.com/jlehmann/git-submod-enhancements/tree/archive--submodules
^ permalink raw reply
* Re: [PATCH] gitweb.perl: fix %highlight_ext
From: rh @ 2012-11-04 17:43 UTC (permalink / raw)
To: git
In-Reply-To: <20121104134503.GB31623@sigill.intra.peff.net>
On Sun, 4 Nov 2012 08:45:03 -0500
Jeff King <peff@peff.net> wrote:
> On Fri, Nov 02, 2012 at 02:18:09PM -0700, rh wrote:
>
> > > I think the patch itself looks OK, but:
> > >
> > > 1. It isn't formatted to apply with git-am. Please use
> > > git-format-patch.
> >
> > git format-patch command wouldn't work for me. I can see that you
> > don't need more stuff to do but not knowing git I couldn't find the
> > correct incantation to do this part. A problem with the files not
> > being in a git repo I think. I'll spare you details.
>
> The usual procedure is:
>
> 1. hack hack hack
>
> 2. git commit
>
> 3. git format-patch
Roger wilco.
>
> And if you are not in a git repo, step 0 is "git init". :)
I had an inkling but nothing more.
Thanks again for the help!
>
> -Peff
--
^ permalink raw reply
* Re: [PATCH] gitweb.perl: fix %highlight_ext mappings
From: rh @ 2012-11-04 17:44 UTC (permalink / raw)
To: git
In-Reply-To: <20121104134841.GC31623@sigill.intra.peff.net>
On Sun, 4 Nov 2012 08:48:41 -0500
Jeff King <peff@peff.net> wrote:
> On Fri, Nov 02, 2012 at 02:12:26PM -0700, rh wrote:
>
> > The previous change created a dictionary of one-to-one elements when
> > the intent was to map mutliple related types to one main type.
> > e.g. bash, ksh, zsh, sh all map to sh since they share similar
> > syntax This makes the mapping as the original change intended.
> >
> > Signed-off-by: rh <richard_hubbe11@lavabit.com>
> >
> > diff --git a/gitweb.cgi.orig b/gitweb.cgi
> > index 060db27..155b238 100755
> > --- a/gitweb.cgi.orig
> > +++ b/gitweb.cgi
>
> Close on the format. There should be a "---" after the sign-off but
> before the diff. I can fix it up locally (and the patch looks good to
> me).
>
> However, one final thing: the point of the sign-off is to indicate
> that you are legally OK to release the code under the DCO. For that
> reason, we usually require a real name (not rh). I can guess at your
> real name from your email, but I'd rather be sure. Can you provide it?
Roger wilco. Resubmitting.
Thanks for the time and consideration.
>
> -Peff
--
^ permalink raw reply
* [PATCH] gitweb.perl: fix %highlight_ext mappings
From: rh @ 2012-11-04 17:45 UTC (permalink / raw)
To: git
The previous change created a dictionary of one-to-one elements when
the intent was to map mutliple related types to one main type.
e.g. bash, ksh, zsh, sh all map to sh since they share similar syntax
This makes the mapping as the original change intended.
Signed-off-by: Richard Hubbell <richard_hubbe11@lavabit.com>
---
gitweb.cgi | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/gitweb.cgi.orig b/gitweb.cgi
index 060db27..155b238 100755
--- a/gitweb.cgi.orig
+++ b/gitweb.cgi
@@ -246,19 +246,19 @@ our %highlight_basename = (
'Makefile' => 'make',
);
# match by extension
+
our %highlight_ext = (
# main extensions, defining name of syntax;
# see files in /usr/share/highlight/langDefs/ directory
- map { $_ => $_ }
- qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql make),
+ (map { $_ => $_ } qw(py rb java css js tex bib xml awk bat ini spec tcl sql)),
# alternate extensions, see /etc/highlight/filetypes.conf
- 'h' => 'c',
- map { $_ => 'sh' } qw(bash zsh ksh),
- map { $_ => 'cpp' } qw(cxx c++ cc),
- map { $_ => 'php' } qw(php3 php4 php5 phps),
- map { $_ => 'pl' } qw(perl pm), # perhaps also 'cgi'
- map { $_ => 'make'} qw(mak mk),
- map { $_ => 'xml' } qw(xhtml html htm),
+ (map { $_ => 'c' } qw(c h)),
+ (map { $_ => 'sh' } qw(sh bash zsh ksh)),
+ (map { $_ => 'cpp' } qw(cpp cxx c++ cc)),
+ (map { $_ => 'php' } qw(php php3 php4 php5 phps)),
+ (map { $_ => 'pl' } qw(pl perl pm)), # perhaps also 'cgi'
+ (map { $_ => 'make'} qw(make mak mk)),
+ (map { $_ => 'xml' } qw(xml xhtml html htm)),
);
# You define site-wide feature defaults here; override them with
^ permalink raw reply related
* Re: [PATCH v2 0/3] Introduce diff.submodule
From: Ramkumar Ramachandra @ 2012-11-04 17:58 UTC (permalink / raw)
To: Jens Lehmann, Jeff King; +Cc: Git List
In-Reply-To: <5092E535.3010701@web.de>
Jens Lehmann wrote:
> Am 01.11.2012 11:43, schrieb Ramkumar Ramachandra:
>> Hi,
>>
>> v1 is here:
>> http://mid.gmane.org/1349196670-2844-1-git-send-email-artagnon@gmail.com
>>
>> I've fixed the issues pointed out in the review by Jens.
>
> Thanks, looking good to me.
Peff, can we pick this up?
Ram
^ permalink raw reply
* git commit/push can fail silently when clone omits ".git"
From: Jeffrey S. Haemer @ 2012-11-04 19:50 UTC (permalink / raw)
To: Git Issues
[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]
Ladies and Gentlemen,
I'm running git 1.7.9.5 on Ubuntu 12.04.1 LTS
I got bitten by what follows. Yes, it's an edge case. Yes I now understand
why it does what it does. Yes the right answer is "Don't do that, Jeff." :-)
Still, it took me a little time to figure out what I'd done wrong because
the failure is silent, so I thought I'd document it. Perhaps there's even
some way to issue an error message for cases like this.
The attached test script shows the issue in detail, but here's the basic
failure:
$ ls
hello.git
$ git clone hello # *Mistake!* Succeeds, but should have cloned "hello.git"
or into something else.
$ cd hello; touch foo; git add foo; git commit -am"add a new file"
$ git status # says I'm a rev ahead of the origin
$ git push # nothing pushed
$ git status # says everything's okay
At this point hello/foo still exists, there's nothing to commit, git diff
origin/master reports nothing, yet foo was never pushed to hello.git.
HTH!
--
Jeffrey Haemer <jeffrey.haemer@gmail.com>
720-837-8908 [cell], http://seejeffrun.blogspot.com [blog],
http://www.youtube.com/user/goyishekop [vlog]
פרייהייט? דאס איז יאַנג דינען וואָרט.
[-- Attachment #2: clone-from-suffixless-gitrepo-issue.sh --]
[-- Type: application/x-sh, Size: 2193 bytes --]
^ permalink raw reply
* git svn problem, probably a regression
From: Joern Huxhorn @ 2012-11-04 20:31 UTC (permalink / raw)
To: git
git svn failed on me with the following error while cloning an SVN repository:
r1216 = fcf69d5102378ee41217d60384b96549bf2173cb (refs/remotes/svn/trunk)
Found possible branch point: svn+ssh://<repositoryName>@<IP address>/trunk => svn+ssh://<repositoryName>@<IP address>/tags/xxxx_2008-10-22, 1216
Use of uninitialized value $u in substitution (s///) at /usr/local/Cellar/git/1.8.0/lib/Git/SVN.pm line 106.
Use of uninitialized value $u in concatenation (.) or string at /usr/local/Cellar/git/1.8.0/lib/Git/SVN.pm line 106.
refs/remotes/svn/asset-manager-redesign: 'svn+ssh://<IP address>' not found in ''
I'm running git 1.8.0 via Homebrew on OS X. It was called via svn2git but I doubt that this is the culprit.
A colleague of mine was able to perform the same operation with git 1.7.x (not sure which) on Debian so I assume that this is a regression.
I just wanted to let you know.
Cheers,
Joern.
^ permalink raw reply
* [PATCH 14/13] wildmatch: fix tests that fail on Windows due to path mangling
From: Johannes Sixt @ 2012-11-04 21:00 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Junio C Hamano
In-Reply-To: <1350282362-4505-13-git-send-email-pclouds@gmail.com>
Patterns beginning with a slash are converted to Windows paths before
test-wildmatch gets to see them. Use a different first character. This
does change the meaning of the test because the slash is special. But:
- The first pair of changed lines the test is about '*' matching an empty
string, which does not need the slash.
- The second pair of changed lines the test is about a sequence of '*/',
and I think we can afford to test without the leading slash.
One case is unchanged:
match 1 x '/foo' '**/foo'
Even though the test is about ** matching zero levels at the beginning of
a path, on Windows, '**' actually matches something because /foo is
converted to c:\path\to\msys\foo. Let's be lazy and let this pass.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
After this change, there are still 3 failing tests that are in connection
with [[:xdigit:]]. Don't know, yet, what's going on there.
t/t3070-wildmatch.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index e6ad6f4..74c0f7c 100755
--- a/t/t3070-wildmatch.sh
+++ b/t/t3070-wildmatch.sh
@@ -95,8 +95,8 @@ match 0 0 ']' '[!]-]'
match 1 x 'a' '[!]-]'
match 0 0 '' '\'
match 0 x '\' '\'
-match 0 x '/\' '*/\'
-match 1 x '/\' '*/\\'
+match 0 x '-\' '*-\'
+match 1 x '-\' '*-\\'
match 1 1 'foo' 'foo'
match 1 1 '@foo' '@foo'
match 0 0 'foo' '@foo'
@@ -187,8 +187,8 @@ match 0 0 '-' '[[-\]]'
match 1 1 '-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
match 0 0 '-adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
match 0 0 '-adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1' '-*-*-*-*-*-*-12-*-*-*-m-*-*-*'
-match 1 1 '/adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1' '/*/*/*/*/*/*/12/*/*/*/m/*/*/*'
-match 0 0 '/adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' '/*/*/*/*/*/*/12/*/*/*/m/*/*/*'
+match 1 1 'adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1' '*/*/*/*/*/*/12/*/*/*/m/*/*/*'
+match 0 0 'adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1' '*/*/*/*/*/*/12/*/*/*/m/*/*/*'
match 1 0 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt' '**/*a*b*g*n*t'
match 0 0 'abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz' '**/*a*b*g*n*t'
--
1.8.0.rc0.45.g6c9d890
^ permalink raw reply related
* [PATCH as/check-ignore] t0007: fix tests on Windows
From: Johannes Sixt @ 2012-11-04 21:07 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Junio C Hamano, Adam Spiers
In-Reply-To: <1350282486-4646-12-git-send-email-pclouds@gmail.com>
The value of $global_excludes is sometimes part of the output
that is tested for. Since git on Windows only sees DOS style paths,
we have to ensure that the "expected" values are constructed in
the same manner. To account for this, use $(pwd) to set the value
of global_excludes.
Additionally, add a SYMLINKS prerequisite to the tests involving
symbolic links.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
t/t0007-ignores.sh | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/t/t0007-ignores.sh b/t/t0007-ignores.sh
index 7fd7e53..5d2b8f2 100755
--- a/t/t0007-ignores.sh
+++ b/t/t0007-ignores.sh
@@ -5,7 +5,7 @@ test_description=check-ignore
. ./test-lib.sh
init_vars () {
- global_excludes="$HOME/global-excludes"
+ global_excludes="$(pwd)/global-excludes"
}
enable_global_excludes () {
@@ -77,18 +77,24 @@ test_check_ignore () {
}
test_expect_success_multi () {
+ prereq=
+ if test $# -eq 4
+ then
+ prereq=$1
+ shift
+ fi
testname="$1" expect_verbose="$2" code="$3"
expect=$( echo "$expect_verbose" | sed -e 's/.* //' )
- test_expect_success "$testname" "
+ test_expect_success $prereq "$testname" "
expect '$expect' &&
$code
"
for quiet_opt in '-q' '--quiet'
do
- test_expect_success "$testname${quiet_opt:+ with $quiet_opt}" "
+ test_expect_success $prereq "$testname${quiet_opt:+ with $quiet_opt}" "
expect '' &&
$code
"
@@ -97,7 +103,7 @@ test_expect_success_multi () {
for verbose_opt in '-v' '--verbose'
do
- test_expect_success "$testname${verbose_opt:+ with $verbose_opt}" "
+ test_expect_success $prereq "$testname${verbose_opt:+ with $verbose_opt}" "
expect '$expect_verbose' &&
$code
"
@@ -108,7 +114,10 @@ test_expect_success_multi () {
test_expect_success 'setup' '
init_vars
mkdir -p a/b/ignored-dir a/submodule b &&
- ln -s b a/symlink &&
+ if test_have_prereq SYMLINKS
+ then
+ ln -s b a/symlink
+ fi &&
(
cd a/submodule &&
git init &&
@@ -326,16 +335,16 @@ test_expect_success 'cd to ignored sub-directory with -v' '
#
# test handling of symlinks
-test_expect_success_multi 'symlink' '' '
+test_expect_success_multi SYMLINKS 'symlink' '' '
test_check_ignore "a/symlink" 1
'
-test_expect_success_multi 'beyond a symlink' '' '
+test_expect_success_multi SYMLINKS 'beyond a symlink' '' '
test_check_ignore "a/symlink/foo" 128 &&
test_stderr "fatal: '\''a/symlink/foo'\'' is beyond a symbolic link"
'
-test_expect_success_multi 'beyond a symlink from subdirectory' '' '
+test_expect_success_multi SYMLINKS 'beyond a symlink from subdirectory' '' '
(
cd a &&
test_check_ignore "symlink/foo" 128
--
1.8.0.rc0.45.g6c9d890
^ permalink raw reply related
* [PATCH] git p4: RCS expansion should not span newlines
From: Pete Wyckoff @ 2012-11-04 22:04 UTC (permalink / raw)
To: git; +Cc: Chris Goard
In-Reply-To: <CACtYWOYOSxmogJHy70McsRVf0m2PVuu=q+pDZ2-gAza7vpeEiA@mail.gmail.com>
This bug was introduced in cb585a9 (git-p4: keyword
flattening fixes, 2011-10-16). The newline character
is indeed special, and $File$ expansions should not try
to match across multiple lines.
Based-on-patch-by: Chris Goard <cgoard@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
---
cgoard@gmail.com wrote on Mon, 16 Jul 2012 12:49 -0700:
> Hi. Noticed an apparent bug in git-p4 related to RCS keyword
> expansion. Some files in our Perforce repository have malformed RCS
> keywords, e.g. "$Revision:" without a closing $. Perforce doesn't
> expand these, obviously, but when a change to this file is imported
> into git, everything up to the next $, on another line much later in
> the file, is deleted. Seems to be due to multi-line matching of RCS
> keywords. One fix is:
>
> diff --git a/git-p4.py b/git-p4.py
> index f895a24..ae7b431 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -215,7 +215,7 @@ def p4_keywords_regexp_for_type(base, type_mods):
> pattern = r"""
> \$ # Starts with a dollar, followed by...
> (%s) # one of the keywords, followed by...
> - (:[^$]+)? # possibly an old expansion, followed by...
> + (:[^\n$]+)? # possibly an old expansion, followed by...
> \$ # another dollar
> """ % kwords
> return pattern
Chris,
I finally got around to building a test-case for this. The bug
has been in since around 1.7.7, so I won't call this exactly
urgent, even though it is blatantly buggy as is.
Will try to get it into the next release.
Thanks,
-- Pete
git-p4.py | 2 +-
t/t9810-git-p4-rcs.sh | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index 882b1bb..7d6c928 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -227,7 +227,7 @@ def p4_keywords_regexp_for_type(base, type_mods):
pattern = r"""
\$ # Starts with a dollar, followed by...
(%s) # one of the keywords, followed by...
- (:[^$]+)? # possibly an old expansion, followed by...
+ (:[^$\n]+)? # possibly an old expansion, followed by...
\$ # another dollar
""" % kwords
return pattern
diff --git a/t/t9810-git-p4-rcs.sh b/t/t9810-git-p4-rcs.sh
index fe30ad8..0c2fc3e 100755
--- a/t/t9810-git-p4-rcs.sh
+++ b/t/t9810-git-p4-rcs.sh
@@ -155,6 +155,25 @@ test_expect_success 'cleanup after failure' '
)
'
+# perl $File:: bug check
+test_expect_success 'ktext expansion should not expand multi-line $File::' '
+ (
+ cd "$cli" &&
+ cat >lv.pm <<-\EOF
+ my $wanted = sub { my $f = $File::Find::name;
+ if ( -f && $f =~ /foo/ ) {
+ EOF
+ p4 add -t ktext lv.pm &&
+ p4 submit -d "lv.pm"
+ ) &&
+ test_when_finished cleanup_git &&
+ git p4 clone --dest="$git" //depot &&
+ (
+ cd "$git" &&
+ test_cmp "$cli/lv.pm" lv.pm
+ )
+'
+
#
# Do not scrub anything but +k or +ko files. Sneak a change into
# the cli file so that submit will get a conflict. Make sure that
--
1.7.12.1.457.g468b3ef
^ permalink raw reply related
* Re: checkout-index: unable to create file foo (File exists)
From: Pete Wyckoff @ 2012-11-04 22:10 UTC (permalink / raw)
To: Brian J. Murrell; +Cc: git
In-Reply-To: <k6ulre$bko$1@ger.gmane.org>
brian@interlinx.bc.ca wrote on Thu, 01 Nov 2012 16:25 -0400:
> When we use git on a network filesystem, occasionally and sporadically
> we will see the following from a git checkout command:
>
> error: git checkout-index: unable to create file foo (File exists)
>
> Through a very basic grepping and following of the source it seems that
> the core of the error message is coming from write_entry() in entry.c:
>
> fd = open_output_fd(path, ce, to_tempfile);
> if (fd < 0) {
> free(new);
> return error("unable to create file %s (%s)",
> path, strerror(errno));
> }
>
> So looking into open_output_fd() there is a call to create_file() which
> does:
>
> return open(path, O_WRONLY | O_CREAT | O_EXCL, mode);
>
> I am able to prevent the problem from happening with 100% success by
> simply giving the git checkout a "-q" argument to prevent it from
> emitting progress reports. This would seem to indicate that the problem
> likely revolves around the fact that the progress reporting uses SIGALRM.
>
> Given that O_CREAT | O_EXCL are used in the open() call and that SIGALRM
> (along with SA_RESTART) is being used frequently to do progress updates,
> it seems reasonable to suspect that the problem is that open() is being
> interrupted (but only after it creates the file and before completing)
> by the progress reporting mechanism's SIGALRM and when the progress
> reporting is done, open() is restarted automatically (due to the use of
> SA_RESTART) and fails because the file exists and O_CREAT | O_EXCL are
> used in the open() call.
>
> Does this seem like a reasonable hypothesis?
Fascinating problem and observations.
We've been using NFS with git for quite a while and have never
seen such an error.
> If it does, where does the problem lie here? Is it that SA_RESTART
> should not be used since it's not safe with open() and O_CREAT | O_EXCL
> (and every system call caller should be handling EINTR) or should the
> open() be idempotent so that it can be restarted automatically with
> SA_RESTART? If open(2) is supposed to be idempotent, it would be most
> useful to have a citation to standard where that is specified.
>
> If open() is not required to be idempotent, it's use with O_CREAT |
> O_EXCL and SA_RESTART seems fatally flawed.
man 7 signal (linux man-pages 3.42) describes open() as restartable.
Which network filesystem and OS are you using? The third option is
that there is a bug in the filesystem client.
-- Pete
^ permalink raw reply
* Support for a series of patches, i.e. patchset or changeset?
From: Eric Miao @ 2012-11-05 2:26 UTC (permalink / raw)
To: git
Hi All,
Does anyone know if git has sort of support for a series of patches, i.e.
a patchset or changeset? So whenever we know the SHA1 id of a single
patch/commit, we know the patchset it belongs to. This is normal when
we do big changes and split that into smaller pieces and doing only one
simple thing in a single commit.
This will be especially useful when tracking and cherry-picking changes,
i.e. monitoring on the changes of some specific files, and if a specific
patch is interesting, we may want to apply the whole changeset, not only
that specific one.
Ideas?
- eric
^ permalink raw reply
* [PATCH v2 1/5] push: return reject reasons via a mask
From: Chris Rorvick @ 2012-11-05 3:08 UTC (permalink / raw)
To: git
Cc: Chris Rorvick, Felipe Contreras, Jeff King, Michael Haggerty,
Angelo Borsotti, Philip Oakley, Johannes Sixt, Kacper Kornet
In-Reply-To: <1352084908-32333-1-git-send-email-chris@rorvick.com>
Pass all rejection reasons back from transport_push(). The logic is
simpler and more flexible with regard to providing useful feedback.
Signed-off-by: Chris Rorvick <chris@rorvick.com>
---
builtin/push.c | 13 ++++---------
transport.c | 17 ++++++++---------
transport.h | 9 +++++----
3 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/builtin/push.c b/builtin/push.c
index db9ba30..eaeaf7e 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -244,7 +244,7 @@ static void advise_checkout_pull_push(void)
static int push_with_options(struct transport *transport, int flags)
{
int err;
- int nonfastforward;
+ unsigned int reject_mask;
transport_set_verbosity(transport, verbosity, progress);
@@ -257,7 +257,7 @@ static int push_with_options(struct transport *transport, int flags)
if (verbosity > 0)
fprintf(stderr, _("Pushing to %s\n"), transport->url);
err = transport_push(transport, refspec_nr, refspec, flags,
- &nonfastforward);
+ &reject_mask);
if (err != 0)
error(_("failed to push some refs to '%s'"), transport->url);
@@ -265,18 +265,13 @@ static int push_with_options(struct transport *transport, int flags)
if (!err)
return 0;
- switch (nonfastforward) {
- default:
- break;
- case NON_FF_HEAD:
+ if (reject_mask & NON_FF_HEAD) {
advise_pull_before_push();
- break;
- case NON_FF_OTHER:
+ } else if (reject_mask & NON_FF_OTHER) {
if (default_matching_used)
advise_use_upstream();
else
advise_checkout_pull_push();
- break;
}
return 1;
diff --git a/transport.c b/transport.c
index 9932f40..ae9fda8 100644
--- a/transport.c
+++ b/transport.c
@@ -714,7 +714,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i
}
void transport_print_push_status(const char *dest, struct ref *refs,
- int verbose, int porcelain, int *nonfastforward)
+ int verbose, int porcelain, unsigned int *reject_mask)
{
struct ref *ref;
int n = 0;
@@ -733,18 +733,17 @@ void transport_print_push_status(const char *dest, struct ref *refs,
if (ref->status == REF_STATUS_OK)
n += print_one_push_status(ref, dest, n, porcelain);
- *nonfastforward = 0;
+ *reject_mask = 0;
for (ref = refs; ref; ref = ref->next) {
if (ref->status != REF_STATUS_NONE &&
ref->status != REF_STATUS_UPTODATE &&
ref->status != REF_STATUS_OK)
n += print_one_push_status(ref, dest, n, porcelain);
- if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD &&
- *nonfastforward != NON_FF_HEAD) {
+ if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD) {
if (!strcmp(head, ref->name))
- *nonfastforward = NON_FF_HEAD;
+ *reject_mask |= NON_FF_HEAD;
else
- *nonfastforward = NON_FF_OTHER;
+ *reject_mask |= NON_FF_OTHER;
}
}
}
@@ -1031,9 +1030,9 @@ static void die_with_unpushed_submodules(struct string_list *needs_pushing)
int transport_push(struct transport *transport,
int refspec_nr, const char **refspec, int flags,
- int *nonfastforward)
+ unsigned int *reject_mask)
{
- *nonfastforward = 0;
+ *reject_mask = 0;
transport_verify_remote_names(refspec_nr, refspec);
if (transport->push) {
@@ -1099,7 +1098,7 @@ int transport_push(struct transport *transport,
if (!quiet || err)
transport_print_push_status(transport->url, remote_refs,
verbose | porcelain, porcelain,
- nonfastforward);
+ reject_mask);
if (flags & TRANSPORT_PUSH_SET_UPSTREAM)
set_upstreams(transport, remote_refs, pretend);
diff --git a/transport.h b/transport.h
index 3b21c4a..b9e124a 100644
--- a/transport.h
+++ b/transport.h
@@ -140,11 +140,12 @@ int transport_set_option(struct transport *transport, const char *name,
void transport_set_verbosity(struct transport *transport, int verbosity,
int force_progress);
-#define NON_FF_HEAD 1
-#define NON_FF_OTHER 2
+#define NON_FF_HEAD 0x01
+#define NON_FF_OTHER 0x02
+
int transport_push(struct transport *connection,
int refspec_nr, const char **refspec, int flags,
- int * nonfastforward);
+ unsigned int * reject_mask);
const struct ref *transport_get_remote_refs(struct transport *transport);
@@ -170,7 +171,7 @@ void transport_update_tracking_ref(struct remote *remote, struct ref *ref, int v
int transport_refs_pushed(struct ref *ref);
void transport_print_push_status(const char *dest, struct ref *refs,
- int verbose, int porcelain, int *nonfastforward);
+ int verbose, int porcelain, unsigned int *reject_mask);
typedef void alternate_ref_fn(const struct ref *, void *);
extern void for_each_alternate_ref(alternate_ref_fn, void *);
--
1.7.1
^ permalink raw reply related
* [PATCH v2 2/5] push: add advice for rejected tag reference
From: Chris Rorvick @ 2012-11-05 3:08 UTC (permalink / raw)
To: git
Cc: Chris Rorvick, Felipe Contreras, Jeff King, Michael Haggerty,
Angelo Borsotti, Philip Oakley, Johannes Sixt, Kacper Kornet
In-Reply-To: <1352084908-32333-1-git-send-email-chris@rorvick.com>
Advising the user to fetch and merge only makes sense if the rejected
reference is a branch. If none of the rejections were for branches,
tell the user they need to force the update(s).
Signed-off-by: Chris Rorvick <chris@rorvick.com>
---
builtin/push.c | 16 ++++++++++++++--
cache.h | 1 +
remote.c | 7 +++++++
transport.c | 6 ++++--
transport.h | 5 +++--
5 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/builtin/push.c b/builtin/push.c
index eaeaf7e..77340c0 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -220,6 +220,11 @@ static const char message_advice_checkout_pull_push[] =
"(e.g. 'git pull') before pushing again.\n"
"See the 'Note about fast-forwards' in 'git push --help' for details.");
+static const char message_advice_ref_already_exists[] =
+ N_("Updates were rejected because a matching reference already exists in\n"
+ "the remote and the update is not a fast-forward. Use git push -f if\n"
+ "you really want to make this update.");
+
static void advise_pull_before_push(void)
{
if (!advice_push_non_ff_current || !advice_push_nonfastforward)
@@ -241,6 +246,11 @@ static void advise_checkout_pull_push(void)
advise(_(message_advice_checkout_pull_push));
}
+static void advise_ref_already_exists(void)
+{
+ advise(_(message_advice_ref_already_exists));
+}
+
static int push_with_options(struct transport *transport, int flags)
{
int err;
@@ -265,13 +275,15 @@ static int push_with_options(struct transport *transport, int flags)
if (!err)
return 0;
- if (reject_mask & NON_FF_HEAD) {
+ if (reject_mask & REJECT_NON_FF_HEAD) {
advise_pull_before_push();
- } else if (reject_mask & NON_FF_OTHER) {
+ } else if (reject_mask & REJECT_NON_FF_OTHER) {
if (default_matching_used)
advise_use_upstream();
else
advise_checkout_pull_push();
+ } else if (reject_mask & REJECT_ALREADY_EXISTS) {
+ advise_ref_already_exists();
}
return 1;
diff --git a/cache.h b/cache.h
index a58df84..bc2fc9a 100644
--- a/cache.h
+++ b/cache.h
@@ -1002,6 +1002,7 @@ struct ref {
unsigned int force:1,
merge:1,
nonfastforward:1,
+ forwardable:1,
deletion:1;
enum {
REF_STATUS_NONE = 0,
diff --git a/remote.c b/remote.c
index 04fd9ea..5ecd58d 100644
--- a/remote.c
+++ b/remote.c
@@ -1316,6 +1316,13 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
* always allowed.
*/
+ if (prefixcmp(ref->name, "refs/tags/")) {
+ struct object *old = parse_object(ref->old_sha1);
+ struct object *new = parse_object(ref->new_sha1);
+ ref->forwardable = (old && new &&
+ old->type == OBJ_COMMIT && new->type == OBJ_COMMIT);
+ }
+
ref->nonfastforward =
!ref->deletion &&
!is_null_sha1(ref->old_sha1) &&
diff --git a/transport.c b/transport.c
index ae9fda8..1657798 100644
--- a/transport.c
+++ b/transport.c
@@ -740,10 +740,12 @@ void transport_print_push_status(const char *dest, struct ref *refs,
ref->status != REF_STATUS_OK)
n += print_one_push_status(ref, dest, n, porcelain);
if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD) {
+ if (!ref->forwardable)
+ *reject_mask |= REJECT_ALREADY_EXISTS;
if (!strcmp(head, ref->name))
- *reject_mask |= NON_FF_HEAD;
+ *reject_mask |= REJECT_NON_FF_HEAD;
else
- *reject_mask |= NON_FF_OTHER;
+ *reject_mask |= REJECT_NON_FF_OTHER;
}
}
}
diff --git a/transport.h b/transport.h
index b9e124a..30b88e8 100644
--- a/transport.h
+++ b/transport.h
@@ -140,8 +140,9 @@ int transport_set_option(struct transport *transport, const char *name,
void transport_set_verbosity(struct transport *transport, int verbosity,
int force_progress);
-#define NON_FF_HEAD 0x01
-#define NON_FF_OTHER 0x02
+#define REJECT_NON_FF_HEAD 0x01
+#define REJECT_NON_FF_OTHER 0x02
+#define REJECT_ALREADY_EXISTS 0x04
int transport_push(struct transport *connection,
int refspec_nr, const char **refspec, int flags,
--
1.7.1
^ permalink raw reply related
* [PATCH v2 3/5] push: flag updates
From: Chris Rorvick @ 2012-11-05 3:08 UTC (permalink / raw)
To: git
Cc: Chris Rorvick, Felipe Contreras, Jeff King, Michael Haggerty,
Angelo Borsotti, Philip Oakley, Johannes Sixt, Kacper Kornet
In-Reply-To: <1352084908-32333-1-git-send-email-chris@rorvick.com>
If the reference exists on the remote and the the update is not a
delete, then mark as an update. This is in preparation for handling
tags and branches differently when pushing.
Signed-off-by: Chris Rorvick <chris@rorvick.com>
---
cache.h | 1 +
remote.c | 19 ++++++++++++-------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/cache.h b/cache.h
index bc2fc9a..1d10761 100644
--- a/cache.h
+++ b/cache.h
@@ -1003,6 +1003,7 @@ struct ref {
merge:1,
nonfastforward:1,
forwardable:1,
+ update:1,
deletion:1;
enum {
REF_STATUS_NONE = 0,
diff --git a/remote.c b/remote.c
index 5ecd58d..3d43bb5 100644
--- a/remote.c
+++ b/remote.c
@@ -1323,15 +1323,20 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
old->type == OBJ_COMMIT && new->type == OBJ_COMMIT);
}
- ref->nonfastforward =
+ ref->update =
!ref->deletion &&
- !is_null_sha1(ref->old_sha1) &&
- (!has_sha1_file(ref->old_sha1)
- || !ref_newer(ref->new_sha1, ref->old_sha1));
+ !is_null_sha1(ref->old_sha1);
- if (ref->nonfastforward && !ref->force && !force_update) {
- ref->status = REF_STATUS_REJECT_NONFASTFORWARD;
- continue;
+ if (ref->update) {
+ ref->nonfastforward =
+ ref->update &&
+ (!has_sha1_file(ref->old_sha1)
+ || !ref_newer(ref->new_sha1, ref->old_sha1));
+
+ if (ref->nonfastforward && !ref->force && !force_update) {
+ ref->status = REF_STATUS_REJECT_NONFASTFORWARD;
+ continue;
+ }
}
}
}
--
1.7.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox