Re: git add -p with new file

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 8:18 AM, Ariel wrote: > > If you do git add -p new_file it says: > > No changes. > > Which is a rather confusing message. I would expect it to show me the > content of the file in patch form, in the normal way that -p works, let me > edit it, etc. We could improve it a bit,

1 files changed

2016-12-07 Thread joris
When committing a change that touches a single file, git reports : 1 files changed, 1069 insertions(+), 1063 deletions(-) Note the plural for the single file. Regards, Joris Wu Software developer Brisbane

Re: [PATCH 01/17] mv: convert to using pathspec struct interface

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > Convert the 'internal_copy_pathspec()' function to use the pathspec > struct interface from using the deprecated 'get_pathspec()' interface. > > In addition to this, fix a memory leak caused by only duplicating some > of the pathspec elemen

[PATCH v2] difftool: fix dir-diff index creation when in a subdirectory

2016-12-07 Thread David Aguilar
9ec26e7977 (difftool: fix argument handling in subdirs, 2016-07-18) corrected how path arguments are handled in a subdirectory, but it introduced a regression in how entries outside of the subdirectory are handled by dir-diff. When preparing the right-side of the diff we only include the changed p

Re: [PATCH 02/17] dir: convert create_simplify to use the pathspec struct interface

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > Convert 'create_simplify()' to use the pathspec struct interface from > using the '_raw' entry in the pathspec. It would be even better to kill this create_simplify() and let simplify_away() handle struct pathspec directly. There is a bug

Re: [PATCH 04/17] ls-tree: convert show_recursive to use the pathspec struct interface

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > Convert 'show_recursive()' to use the pathspec struct interface from > using the '_raw' entry in the pathspec struct. Slightly off-topic (sorry, but you made me look at this code! :D), could you update the magic_mask argument of parse_path

Re: [PATCH 03/17] dir: convert fill_directory to use the pathspec struct interface

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > Convert 'fill_directory()' to use the pathspec struct interface from > using the '_raw' entry in the pathspec struct. > > Signed-off-by: Brandon Williams > --- > dir.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --g

Re: [PATCH 09/17] pathspec: always show mnemonic and name in unsupported_magic

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > @@ -413,10 +411,9 @@ void parse_pathspec(struct pathspec *pathspec, > prefixlen = prefix ? strlen(prefix) : 0; > > for (i = 0; i < n; i++) { > - unsigned short_magic; > entry = argv[i]; > > -

Re: [PATCH 09/17] pathspec: always show mnemonic and name in unsupported_magic

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > @@ -426,8 +423,7 @@ void parse_pathspec(struct pathspec *pathspec, > nr_exclude++; > if (item[i].magic & magic_mask) > unsupported_magic(entry, > -

[ANNOUNCE] DeepGit - free cross-platform Git blame GUI with code move detection

2016-12-07 Thread Marc Strapetz
We have just released the first version of DeepGit, a free cross-platform tool to investigate the history of source code. It's based on blame information and comes with a 'fuzzy' line/block move detection. http://www.syntevo.com/deepgit/ -Marc

Re: [PATCH] git-p4: add p4 shelf support

2016-12-07 Thread Luke Diamand
On 6 December 2016 at 16:12, Nuno Subtil wrote: > Yeah, it looks similar. This change can be ignored if those have already > been accepted. Thanks, that's appreciated! Luke

Re: 1 files changed

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:46 PM, joris wrote: > When committing a change that touches a single file, git reports : > > 1 files changed, 1069 insertions(+), 1063 deletions(-) > > Note the plural for the single file. What version? This should be fixed since v1.7.10, unless some new bug pops up somew

Re: [PATCH v15 12/27] bisect--helper: `get_terms` & `bisect_terms` shell function in C

2016-12-07 Thread Pranit Bauva
Hey Stephan, On Wed, Dec 7, 2016 at 4:35 AM, Stephan Beyer wrote: > Hey Pranit, > > On 12/06/2016 10:14 PM, Pranit Bauva wrote: + + if (argc == 0) { + printf(_("Your current terms are %s for the old state\nand " +"%s for the new state.\n"),

Re: [PATCH 16/17] pathspec: small readability changes

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > A few small changes to improve readability. This is done by grouping related > assignments, adding blank lines, ensuring lines are <80 characters, etc. > > Signed-off-by: Brandon Williams > --- > pathspec.c | 15 ++- > 1 file

Re: [PATCH 11/17] pathspec: factor global magic into its own function

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > Create helper functions to read the global magic environment variables > in additon to factoring out the global magic gathering logic into its > own function. > > Signed-off-by: Brandon Williams > --- > pathspec.c | 120 > +++

Re: [PATCH v15 23/27] bisect--helper: `bisect_replay` shell function in C

2016-12-07 Thread Christian Couder
Hi Stephan, On Wed, Dec 7, 2016 at 12:40 AM, Stephan Beyer wrote: > Hi Pranit and Christian and Lars ;) > > On 12/07/2016 12:02 AM, Pranit Bauva wrote: >> On Tue, Nov 22, 2016 at 6:19 AM, Stephan Beyer wrote: >>> >>> Now that I have a coarse overview of what you did, I have the general >>> remar

Re: [PATCH 16/17] pathspec: small readability changes

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > A few small changes to improve readability. This is done by grouping related > assignments, adding blank lines, ensuring lines are <80 characters, etc. > > Signed-off-by: Brandon Williams > --- > pathspec.c | 15 ++- > 1 file

[no subject]

2016-12-07 Thread Vivek Patil
-- Thanks & Regrads Vivek Patil

Re: [PATCH] clone,fetch: explain the shallow-clone option a little more clearly

2016-12-07 Thread Duy Nguyen
On Wed, Dec 7, 2016 at 1:29 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Tue, Dec 6, 2016 at 1:28 AM, Junio C Hamano wrote: >>> I however offhand do not think the feature can be used to make the >>> repository shallower >> >> I'm pretty sure it can,... > > I wrote my message after a sh

[no subject]

2016-12-07 Thread Vivek Patil
-- Thanks & Regrads Vivek Patil

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-07 Thread Christian Couder
On Tue, Dec 6, 2016 at 7:58 PM, Junio C Hamano wrote: > I was burned a few times with this in the past few years, but it did > not irritate me often enough that I didn't write it down. But I > think this is serious enough that deserves attention from those who > were involved. Yeah, I agree that

[PATCH v8 02/19] ref-filter: include reference to 'used_atom' within 'atom_value'

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Ensure that each 'atom_value' has a reference to its corresponding 'used_atom'. This let's us use values within 'used_atom' in the 'handler' function. Hence we can get the %(align) atom's parameters directly from the 'used_atom' therefore removing the necessity of passing %(a

[PATCH v8 00/19] port branch.c to use ref-filter's printing options

2016-12-07 Thread Karthik Nayak
This is part of unification of the commands 'git tag -l, git branch -l and git for-each-ref'. This ports over branch.c to use ref-filter's printing options. Initially posted here: $(gmane/279226). It was decided that this series would follow up after refactoring ref-filter parsing mechanism, which

[PATCH v8 16/19] ref-filter: allow porcelain to translate messages in the output

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Introduce setup_ref_filter_porcelain_msg() so that the messages used in the atom %(upstream:track) can be translated if needed. By default, keep the messages untranslated, which is the right behavior for plumbing commands. This is needed as we port branch.c to use ref-filter's

[PATCH v8 13/19] ref-filter: rename the 'strip' option to 'lstrip'

2016-12-07 Thread Karthik Nayak
In preparation for the upcoming patch, where we introduce the 'rstrip' option. Rename the 'strip' option to 'lstrip' to remove ambiguity. Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 10 +- builtin/tag.c | 4 ++-- ref-filter.c

[PATCH v8 14/19] ref-filter: modify the 'lstrip=' option to work with negative ''

2016-12-07 Thread Karthik Nayak
Currently the 'lstrip=' option only takes a positive value '' and strips '' slash-separated path components from the left. Modify the 'lstrip' option to also take a negative number '' which would only _leave_ behind 'N' slash-separated path components from the left. Add documentation and tests for

[PATCH v8 10/19] ref-filter: introduce refname_atom_parser_internal()

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Since there are multiple atoms which print refs ('%(refname)', '%(symref)', '%(push)', '%(upstream)'), it makes sense to have a common ground for parsing them. This would allow us to share implementations of the atom modifiers between these atoms. Introduce refname_atom_parse

[PATCH v8 11/19] ref-filter: introduce refname_atom_parser()

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Using refname_atom_parser_internal(), introduce refname_atom_parser() which will parse the %(symref) and %(refname) atoms. Store the parsed information into the 'used_atom' structure based on the modifiers used along with the atoms. Now the '%(symref)' atom supports the ':str

[PATCH v8 12/19] ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Use the recently introduced refname_atom_parser_internal() within remote_ref_atom_parser(), this provides a common base for all the ref printing atoms, allowing %(upstream) and %(push) to also use the ':strip' option. The atoms '%(push)' and '%(upstream)' will retain the ':tr

[PATCH v8 15/19] ref-filter: add an 'rstrip=' option to atoms which deal with refnames

2016-12-07 Thread Karthik Nayak
Complimenting the existing 'lstrip=' option, add an 'rstrip=' option which strips `` slash-separated path components from the end of the refname (e.g., `%(refname:rstrip=2)` turns `refs/tags/foo` into `refs`). Signed-off-by: Karthik Nayak --- Documentation/git-for-each-ref.txt | 40 +

[PATCH v8 19/19] branch: implement '--format' option

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Implement the '--format' option provided by 'ref-filter'. This lets the user list branches as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-of

[PATCH v8 18/19] branch: use ref-filter printing APIs

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Port branch.c to use ref-filter APIs for printing. This clears out most of the code used in branch.c for printing and replaces them with calls made to the ref-filter library. Introduce build_format() which gets the format required for printing of refs. Make amendments to prin

[PATCH v8 17/19] branch, tag: use porcelain output

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Call ref-filter's setup_ref_filter_porcelain_msg() to enable translated messages for the %(upstream:tack) atom. Although branch.c doesn't currently use ref-filter's printing API's, this will ensure that when it does in the future patches, we do not need to worry about translat

[PATCH v8 07/19] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Borrowing from branch.c's implementation print "[gone]" whenever an unknown upstream ref is encountered instead of just ignoring it. This makes sure that when branch.c is ported over to using ref-filter APIs for printing, this feature is not lost. Make changes to t/t6300-for

[PATCH v8 01/19] ref-filter: implement %(if), %(then), and %(else) atoms

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Implement %(if), %(then) and %(else) atoms. Used as %(if)...%(then)...%(end) or %(if)...%(then)...%(else)...%(end). If the format string between %(if) and %(then) expands to an empty string, or to only whitespaces, then the whole %(if)...%(end) expands to the string following

[PATCH v8 05/19] ref-filter: move get_head_description() from branch.c

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Move the implementation of get_head_description() from branch.c to ref-filter. This gives a description of the HEAD ref if called. This is used as the refname for the HEAD ref whenever the FILTER_REFS_DETACHED_HEAD option is used. Make it public because we need it to calculat

[PATCH v8 09/19] ref-filter: make "%(symref)" atom work with the ':short' modifier

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak The "%(symref)" atom doesn't work when used with the ':short' modifier because we strictly match only 'symref' for setting the 'need_symref' indicator. Fix this by comparing with the valid_atom rather than the used_atom. Add tests for %(symref) and %(symref:short) while we're

[PATCH v8 03/19] ref-filter: implement %(if:equals=) and %(if:notequals=)

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Implement %(if:equals=) wherein the if condition is only satisfied if the value obtained between the %(if:...) and %(then) atom is the same as the given ''. Similarly, implement (if:notequals=) wherein the if condition is only satisfied if the value obtained between the %(if:

[PATCH v8 08/19] ref-filter: add support for %(upstream:track,nobracket)

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Add support for %(upstream:track,nobracket) which will print the tracking information without the brackets (i.e. "ahead N, behind M"). This is needed when we port branch.c to use ref-filter's printing APIs. Add test and documentation for the same. Mentored-by: Christian Coud

[PATCH v8 04/19] ref-filter: modify "%(objectname:short)" to take length

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak Add support for %(objectname:short=) which would print the abbreviated unique objectname of given length. When no length is specified, the length is 'DEFAULT_ABBREV'. The minimum length is 'MINIMUM_ABBREV'. The length may be exceeded to ensure that the provided object name is

[PATCH v8 06/19] ref-filter: introduce format_ref_array_item()

2016-12-07 Thread Karthik Nayak
From: Karthik Nayak To allow column display, we will need to first render the output in a string list to allow print_columns() to compute the proper size of each column before starting the actual output. Introduce the function format_ref_array_item() that does the formatting of a ref_array_item t

Re: git repo vs project level authorization

2016-12-07 Thread Sitaram Chamarty
Ken, On Mon, Dec 05, 2016 at 11:04:44PM +0100, Fredrik Gustafsson wrote: > On Mon, Dec 05, 2016 at 03:33:51PM -0500, ken edward wrote: > > I am currently using svn with apache+mod_dav_svn to have a single > > repository with multiple projects. Each of the projects is controlled > > by an access co

[PATCH 2/2] ref-filter: add function to parse atoms from a nul-terminated string

2016-12-07 Thread SZEDER Gábor
ref-filter's parse_ref_filter_atom() function parses an atom between the start and end pointers it gets as arguments. This is fine for two of its callers, which process '%(atom)' format specifiers and the end pointer comes directly from strchr() looking for the closing ')'. However, it's not quite

[PATCH 0/2] A bit of ref-filter atom parsing cleanups

2016-12-07 Thread SZEDER Gábor
The diffstat of the second patch doesn't show any benefits, but only because the first patch removed a callsite that would have benefited from it. It merges cleanly with Karthik's "port branch.c to use ref-filter's printing options" series. SZEDER Gábor (2): ref-filter, tag: eliminate duplicate

[PATCH 1/2] ref-filter, tag: eliminate duplicated sorting option parsing

2016-12-07 Thread SZEDER Gábor
Sorting options are either specified on the command line, which is handled by parse_opt_ref_sorting() in ref-filter.c, or via the 'tag.sort' config variable, which is handled by parse_sorting_string() in builtin/tag.c. These two functions are nearly identical, the difference being only their signa

Re: Re* [BUG] Index.lock error message regression in git 2.11.0

2016-12-07 Thread Junio C Hamano
Junio C Hamano writes: > ... > I would not be surprised if some existing calls to hold_lock*() > functions that pass die_on_error=0 need to be updated to pass > LOCK_SILENT_ON_ERROR, and when this fix is taken alone, it may look > like a regression, but we are better off starting louder and squel

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-07 Thread Stephan Beyer
Hi, On 12/06/2016 07:58 PM, Junio C Hamano wrote: > I was burned a few times with this in the past few years, but it did > not irritate me often enough that I didn't write it down. But I > think this is serious enough that deserves attention from those who > were involved. > > A short reproducti

[PATCH] submodule--helper: set alternateLocation for cloned submodules

2016-12-07 Thread vi0oss
From: Vitaly _Vi Shukela Git v2.11 introduced "git clone --recursive --referece ...", but it didn't put the alternates for _nested_ submodules. This patch makes all not just the root repository, but also all submodules (recursively) have submodule.alternateLocation and submodule.alternateErrorSt

[PATCH 2/3] hold_locked_index(): align error handling with hold_lockfile_for_update()

2016-12-07 Thread Junio C Hamano
Callers of the hold_locked_index() function pass 0 when they want to prepare to write a new version of the index file without wishing to die or emit an error message when the request fails (e.g. somebody else already held the lock), and pass 1 when they want the call to die upon failure. This opti

[PATCH 0/3] Do not be totally silent upon lock error

2016-12-07 Thread Junio C Hamano
Robbie Iannucci reported that "git merge" that fast-forwards fails silently when a competing or stale index.lock is present in recent Git: $ git merge --ff-only master; echo $? Updating 454cb6bd52..8d7a455ed5 1 $ exit Did the update happen? We used to give "fatal: Unable to creat

[PATCH 3/3] lockfile: LOCK_REPORT_ON_ERROR

2016-12-07 Thread Junio C Hamano
The "libify sequencer" topic stopped passing the die_on_error option to hold_locked_index(), and this lost an error message from "git merge --ff-only $commit" when there are competing updates in progress. The command still exits with a non-zero status, but that is not of much help for an interacti

[PATCH 1/3] wt-status: implement opportunisitc index update correctly

2016-12-07 Thread Junio C Hamano
The require_clean_work_tree() function calls hold_locked_index() with die_on_error=0 to signal that it is OK if it fails to obtain the lock, but unconditionally calls update_index_if_able(), which will try to write into fd=-1. Signed-off-by: Junio C Hamano --- wt-status.c | 7 --- 1 file cha

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-07 Thread Junio C Hamano
Stephan Beyer writes: > [1] By the way: git cherry-pick --quit, git rebase --forget ... > different wording for the same thing makes things unintuitive. It is not too late to STOP "--forget" from getting added to "rebase" and give it a better name. Having said that, I have a feeling that these

Re: [PATCH] submodule--helper: set alternateLocation for cloned submodules

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 10:42 AM, wrote: > From: Vitaly _Vi Shukela Thanks for contributing to Git! (/me looks up if you have sent patches already as you seem to know how to do that. :) unrelated side note: Maybe you want to send a patch for the .mailmap file mapping your two email addresses tog

Re: [PATCH] real_path: make real_path thread-safe

2016-12-07 Thread Torsten Bögershausen
On Wed, Dec 07, 2016 at 01:12:25AM +, Ramsay Jones wrote: > > > On 07/12/16 00:10, Brandon Williams wrote: > > On 12/06, Junio C Hamano wrote: > >> POSIX cares about treating "//" at the very beginning of the path > >> specially. Is that supposed to be handled here, or by a lot higher > >> l

Re: [PATCH] submodule--helper: set alternateLocation for cloned submodules

2016-12-07 Thread Junio C Hamano
Stefan Beller writes: >> This patch makes all not just the root repository, but also >> all submodules (recursively) have submodule.alternateLocation >> and submodule.alternateErrorStrategy configured, making Git >> search for possible alternates for nested submodules as well. > > Sounds great!

Re: [PATCH] submodule--helper: set alternateLocation for cloned submodules

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 12:18 PM, Junio C Hamano wrote: > Stefan Beller writes: > >>> This patch makes all not just the root repository, but also >>> all submodules (recursively) have submodule.alternateLocation >>> and submodule.alternateErrorStrategy configured, making Git >>> search for possibl

Re: [PATCH] submodule--helper: set alternateLocation for cloned submodules

2016-12-07 Thread Junio C Hamano
Stefan Beller writes: > On Wed, Dec 7, 2016 at 12:18 PM, Junio C Hamano wrote: >> Stefan Beller writes: >> This patch makes all not just the root repository, but also all submodules (recursively) have submodule.alternateLocation and submodule.alternateErrorStrategy configured, ma

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-07 Thread Stephan Beyer
Hi, On 12/07/2016 09:04 PM, Junio C Hamano wrote: > Stephan Beyer writes: > >> [1] By the way: git cherry-pick --quit, git rebase --forget ... >> different wording for the same thing makes things unintuitive. > > It is not too late to STOP "--forget" from getting added to "rebase" > and give it

Re: [PATCH] real_path: make real_path thread-safe

2016-12-07 Thread Junio C Hamano
Torsten Bögershausen writes: > But in any case it seems that e.g. > //SEFVER/SHARE/DIR1/DIR2/.. > must be converted into > //SEFVER/SHARE/DIR1 > > and > \\SEFVER\SHARE\DIR1\DIR2\.. > must be converted into > \\SEFVER\SHARE\DIR1 Additional questions that may be interesting are: //A/B/../C

Re: [PATCH] real_path: make real_path thread-safe

2016-12-07 Thread Johannes Sixt
Am 07.12.2016 um 01:10 schrieb Brandon Williams: This function should accept both absolute and relative paths, which means it should probably accept "C:\My Files". I wasn't thinking about windows 100% of the time while writing this so I'm hoping that a windows expert will point things like this

Re: [PATCH 1/3] wt-status: implement opportunisitc index update correctly

2016-12-07 Thread Junio C Hamano
On Wed, Dec 7, 2016 at 12:48 PM, Stefan Beller wrote: > > So I would expect that we'd rather fix the update_index_if_able instead by > checking for the lockfile to be in the correct state? I actually don't expect that, after looking at other call sites of that function.

Re: [PATCH 1/3] wt-status: implement opportunisitc index update correctly

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 12:53 PM, Junio C Hamano wrote: > On Wed, Dec 7, 2016 at 12:48 PM, Stefan Beller wrote: >> >> So I would expect that we'd rather fix the update_index_if_able instead by >> checking for the lockfile to be in the correct state? > > I actually don't expect that, after looking

Re: [PATCH 1/3] wt-status: implement opportunisitc index update correctly

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 11:41 AM, Junio C Hamano wrote: > The require_clean_work_tree() function calls hold_locked_index() > with die_on_error=0 to signal that it is OK if it fails to obtain > the lock, but unconditionally calls update_index_if_able(), which > will try to write into fd=-1. > > Sign

[PATCHv5 4/5] worktree: get worktrees from submodules

2016-12-07 Thread Stefan Beller
In a later patch we want to move around the the git directory of a submodule. Both submodules as well as worktrees are involved in placing git directories at unusual places, so their functionality may collide. To react appropriately to situations where worktrees in submodules are in use, offer a ne

[PATCHv5 5/5] submodule: add embed-git-dir function

2016-12-07 Thread Stefan Beller
When a submodule has its git dir inside the working dir, the submodule support for checkout that we plan to add in a later patch will fail. Add functionality to migrate the git directory to be embedded into the superprojects git directory. The newly added code in this patch is structured such tha

[PATCHv5 3/5] test-lib-functions.sh: teach test_commit -C

2016-12-07 Thread Stefan Beller
Specifically when setting up submodule tests, it comes in handy if we can create commits in repositories that are not at the root of the tested trash dir. Add "-C " similar to gits -C parameter that will perform the operation in the given directory. Signed-off-by: Stefan Beller Signed-off-by: Jun

[PATCHv5 0/5] submodule embedgitdirs

2016-12-07 Thread Stefan Beller
v5: * Add another layer of abstraction, i.e. the relocate_git_dir is only about moving a git dir of one repository. The submodule specific stuff (e.g. recursion into nested submodules) is in submodule.{c,h} This was motivated by reviews on the series of checkout aware of submodules buil

[PATCHv5 2/5] submodule helper: support super prefix

2016-12-07 Thread Stefan Beller
Just like main commands in Git, the submodule helper needs access to the superproject prefix. Enable this in the git.c but have its own fuse in the helper code by having a flag to turn on the super prefix. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- builtin/submodule--helper.

[PATCHv5 1/5] submodule: use absolute path for computing relative path connecting

2016-12-07 Thread Stefan Beller
The current caller of connect_work_tree_and_git_dir passes an absolute path for the `git_dir` parameter. In the future patch we will also pass in relative path for `git_dir`. Extend the functionality of connect_work_tree_and_git_dir to take relative paths for parameters. We could work around this

Re: [PATCH 1/3] wt-status: implement opportunisitc index update correctly

2016-12-07 Thread Junio C Hamano
Stefan Beller writes: > So my first question I had to answer was if we do the right thing here, > i.e. if we could just fail instead. But we want to continue and just > not write back the index, which is fine. > > So we do not have to guard refresh_cache, but just call > update_index_if_able cond

Re: [PATCH] submodule--helper: set alternateLocation for cloned submodules

2016-12-07 Thread vi0oss
On 12/07/2016 11:09 PM, Stefan Beller wrote: As submodule's alternate target does not end in .git/objects (rather .git/modules/qq/objects), this alternate target path restriction for in add_possible_reference_from_superproject relates from "*.git/objects" to just */objects". I wonder if this

[PATCH 2/5] am: Change safe_to_abort()'s not rewinding error into a warning

2016-12-07 Thread Stephan Beyer
The error message tells the user that something went terribly wrong and the --abort could not be performed. But the --abort is performed, only without rewinding. By simply changing the error into a warning, we indicate the user that she must not try something like "git am --abort --force", instead

[PATCH 4/5] Make sequencer abort safer

2016-12-07 Thread Stephan Beyer
In contrast to "git am --abort", a sequencer abort did not check whether the current HEAD is the one that is expected. This can lead to loss of work (when not spotted and resolved using reflog before the garbage collector chimes in). This behavior is now changed by mimicking "git am --abort": the

[PATCH 3/5] Add test that cherry-pick --abort does not unsafely change HEAD

2016-12-07 Thread Stephan Beyer
Signed-off-by: Stephan Beyer --- t/t3510-cherry-pick-sequence.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh index 7b7a89dbd..372307c21 100755 --- a/t/t3510-cherry-pick-sequence.sh +++ b/t/t3510-cherry-pick-sequ

[PATCH 1/5] am: Fix filename in safe_to_abort() error message

2016-12-07 Thread Stephan Beyer
Signed-off-by: Stephan Beyer --- Okay let's give it a try. Some minor things that I found are also in this patchset (patch 01, 02 and 05). The branch can also be found on https://github.com/sbeyer/git/commits/sequencer-abort-safety builtin/am.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH 5/5] sequencer: Remove useless get_dir() function

2016-12-07 Thread Stephan Beyer
This function is used only once, for the removal of the directory. It is not used for the creation of the directory nor anywhere else. Signed-off-by: Stephan Beyer --- sequencer.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sequencer.c b/sequencer.c index c9b560ac1.

Re: [PATCH 00/17] pathspec cleanup

2016-12-07 Thread Junio C Hamano
Brandon Williams writes: > The intent of this series is to cleanup some of the pathspec initialization > code as well as finally migrating the remaining users of the _raw field or > get_pathspec() to the pathspec struct interface. This way both the _raw field > and get_pathspec() can be removed

Re: [PATCH 16/17] pathspec: small readability changes

2016-12-07 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: >> A few small changes to improve readability. This is done by grouping related >> assignments, adding blank lines, ensuring lines are <80 characters, etc. >> >> Signed-off-by: Brandon Williams >> --- >> pathspec.c |

Re: [PATCH 1/3] wt-status: implement opportunisitc index update correctly

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 1:08 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> So my first question I had to answer was if we do the right thing here, >> i.e. if we could just fail instead. But we want to continue and just >> not write back the index, which is fine. >> >> So we do not have to

Re: [PATCH 2/2] describe: add support for multiple match patterns

2016-12-07 Thread Junio C Hamano
Jacob Keller writes: > ... Suppose that you version all > your official releases such as "v1.2", "v1.3", "v1.4", "v2.1" and so on. > Now, you also have other tags which represent -rc releases and other > such tags. If you want to find the first major release that contains > a given commit you mig

Re: [PATCH] submodule--helper: set alternateLocation for cloned submodules

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 1:24 PM, vi0oss wrote: > On 12/07/2016 11:09 PM, Stefan Beller wrote: >>> >>> As submodule's alternate target does not end in .git/objects >>> (rather .git/modules/qq/objects), this alternate target >>> path restriction for in add_possible_reference_from_superproject >>>

Re: [PATCH] real_path: make real_path thread-safe

2016-12-07 Thread Brandon Williams
On 12/07, Junio C Hamano wrote: > Torsten Bögershausen writes: > > > But in any case it seems that e.g. > > //SEFVER/SHARE/DIR1/DIR2/.. > > must be converted into > > //SEFVER/SHARE/DIR1 > > > > and > > \\SEFVER\SHARE\DIR1\DIR2\.. > > must be converted into > > \\SEFVER\SHARE\DIR1 > > Additiona

Re: [PATCH] real_path: make real_path thread-safe

2016-12-07 Thread Brandon Williams
On 12/07, Johannes Sixt wrote: > Am 07.12.2016 um 01:10 schrieb Brandon Williams: > >This function should accept both absolute and relative paths, which > >means it should probably accept "C:\My Files". I wasn't thinking about > >windows 100% of the time while writing this so I'm hoping that a win

Re: [PATCHv5 0/5] submodule embedgitdirs

2016-12-07 Thread Junio C Hamano
Stefan Beller writes: > v5: > * Add another layer of abstraction, i.e. the relocate_git_dir is only about > moving a git dir of one repository. The submodule specific stuff (e.g. > recursion into nested submodules) is in submodule.{c,h} > > This was motivated by reviews on the series of

Re: [PATCH 16/17] pathspec: small readability changes

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > > A few small changes to improve readability. This is done by grouping > > related > > assignments, adding blank lines, ensuring lines are <80 characters, etc. > > > > Signed-off-by: Brandon Williams > > ---

Re: [PATCH 11/17] pathspec: factor global magic into its own function

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > > Create helper functions to read the global magic environment variables > > in additon to factoring out the global magic gathering logic into its > > own function. > > > > Signed-off-by: Brandon Williams > >

Re: [PATCH 09/17] pathspec: always show mnemonic and name in unsupported_magic

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > > @@ -426,8 +423,7 @@ void parse_pathspec(struct pathspec *pathspec, > > nr_exclude++; > > if (item[i].magic & magic_mask) > > unsupported_magic(e

Re: [PATCH 09/17] pathspec: always show mnemonic and name in unsupported_magic

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > > @@ -413,10 +411,9 @@ void parse_pathspec(struct pathspec *pathspec, > > prefixlen = prefix ? strlen(prefix) : 0; > > > > for (i = 0; i < n; i++) { > > - unsigned short_magic; > >

Re: [PATCH 04/17] ls-tree: convert show_recursive to use the pathspec struct interface

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > > Convert 'show_recursive()' to use the pathspec struct interface from > > using the '_raw' entry in the pathspec struct. > > Slightly off-topic (sorry, but you made me look at this code! :D), > could you upda

Re: [PATCH 03/17] dir: convert fill_directory to use the pathspec struct interface

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > > Convert 'fill_directory()' to use the pathspec struct interface from > > using the '_raw' entry in the pathspec struct. > > > > Signed-off-by: Brandon Williams > > --- > > dir.c | 3 ++- > > 1 file changed,

Re: [PATCHv5 4/5] worktree: get worktrees from submodules

2016-12-07 Thread Junio C Hamano
Stefan Beller writes: > + submodule_common_dir = strbuf_detach(&sb, NULL); > + ret = get_worktrees_internal(submodule_common_dir, flags); > + > + free(submodule_gitdir); This sequence felt somewhat unusual. I would have written this without an extra variable, i.e. ret = get

[PATCH 1/2] submodule--helper: set alternateLocation for cloned submodules

2016-12-07 Thread vi0oss
From: "Vitaly \"_Vi\" Shukela" In 31224cbdc7 (clone: recursive and reference option triggers submodule alternates, 2016-08-17) a mechanism was added to have submodules referenced. It did not address _nested_ submodules, however. This patch makes all not just the root repository, but also all su

[PATCH 2/2] mailmap: Update my e-mail address

2016-12-07 Thread vi0oss
From: "Vitaly \"_Vi\" Shukela" Signed-off-by: Vitaly "_Vi" Shukela --- .mailmap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 9cc33e9..b7ae81a 100644 --- a/.mailmap +++ b/.mailmap @@ -246,7 +246,7 @@ Uwe Kleine-König Uwe Kleine-König Vill

Re: [PATCHv5 4/5] worktree: get worktrees from submodules

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 2:45 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> + submodule_common_dir = strbuf_detach(&sb, NULL); >> + ret = get_worktrees_internal(submodule_common_dir, flags); >> + >> + free(submodule_gitdir); > > This sequence felt somewhat unusual. I would hav

Re: [PATCHv5 5/5] submodule: add embed-git-dir function

2016-12-07 Thread Junio C Hamano
Stefan Beller writes: > @@ -1093,7 +1129,8 @@ static struct cmd_struct commands[] = { > {"resolve-relative-url", resolve_relative_url, 0}, > {"resolve-relative-url-test", resolve_relative_url_test, 0}, > {"init", module_init, 0}, > - {"remote-branch", resolve_remote_submodul

Re: BUG: "cherry-pick A..B || git reset --hard OTHER"

2016-12-07 Thread Duy Nguyen
On Thu, Dec 8, 2016 at 3:35 AM, Stephan Beyer wrote: > Hi, > > On 12/07/2016 09:04 PM, Junio C Hamano wrote: >> Stephan Beyer writes: >> >>> [1] By the way: git cherry-pick --quit, git rebase --forget ... >>> different wording for the same thing makes things unintuitive. >> >> It is not too late

Re: [PATCH 16/17] pathspec: small readability changes

2016-12-07 Thread Brandon Williams
On 12/07, Duy Nguyen wrote: > On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams wrote: > > A few small changes to improve readability. This is done by grouping > > related > > assignments, adding blank lines, ensuring lines are <80 characters, etc. > > > > Signed-off-by: Brandon Williams > > ---

Re: [PATCHv5 0/5] submodule embedgitdirs

2016-12-07 Thread Junio C Hamano
Junio C Hamano writes: > Stefan Beller writes: > >> v5: >> * Add another layer of abstraction, i.e. the relocate_git_dir is only about >> moving a git dir of one repository. The submodule specific stuff (e.g. >> recursion into nested submodules) is in submodule.{c,h} >> >> This was mot

Re: [PATCHv5 5/5] submodule: add embed-git-dir function

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 3:03 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> @@ -1093,7 +1129,8 @@ static struct cmd_struct commands[] = { >> {"resolve-relative-url", resolve_relative_url, 0}, >> {"resolve-relative-url-test", resolve_relative_url_test, 0}, >> {"init", modu

  1   2   >