git MUST notify user when files will be deleted or overwritten by command

2019-03-09 Thread Dimitri Joukoff
Hi, As a relatively novice user of git, there have been far too many times that I have lost data, sometimes quite a lot. So this proposal is about catering for the less experienced users and averting fits of anger and frustration. The only reason my computer still works is because my sub-conscio

Git server side "pre-receive" hook to create new repositories

2019-03-09 Thread Dimitri Joukoff
Some time ago, Feb 2018, I put in a proposal at Swift.org , that would allow the Swift Package Manager to clone packages from the Internet to a local git server and use the local version without requiring updates to the Swift package: https://forums.swift.org/t/proposal-to-enable-spm-to-use-a-local

Re: git MUST notify user when files will be deleted or overwritten by command

2019-03-09 Thread Kevin Daudt
On Sat, Mar 09, 2019 at 10:19:03AM +, Dimitri Joukoff wrote: > Hi, > > As a relatively novice user of git, there have been far too many times > that I have lost data, sometimes quite a lot. So this proposal is about > catering for the less experienced users and averting fits of anger and > fr

--with-curl vs --with-curl-path=PATH

2019-03-09 Thread Jeffrey Walton
I'm trying to build Git and install it in a discardable directory. All of Git's prereqs have been built and are there. Git was configured with --with-curl, but it looks like Git cannot find the cURL built for it (see below). I tried adding -lcurl to LDLIBS but it does not appear to be honored. cUR

Re: [PATCH v3 00/21] Add new command "switch"

2019-03-09 Thread Duy Nguyen
On Sat, Mar 9, 2019 at 12:49 AM Ramsay Jones wrote: > > > > On 08/03/2019 09:57, Nguyễn Thái Ngọc Duy wrote: > [snip] > > Range-diff dựa trên v2: > > -: -- > 1: 949f3dd4fd git-checkout.txt: spell out --no-option > > 1: 8358b9ca36 = 2: 1ddbbae3e2 git-checkout.txt: fix one syntax lin

Re: [PATCH v1 01/11] checkout: split part of it to new command 'restore'

2019-03-09 Thread Duy Nguyen
On Sat, Mar 9, 2019 at 1:01 AM Elijah Newren wrote: > > Thanks for working on this; overall looks really good. I've got a few > comments here and there on the wording and combinations of options... > > On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > +SYNOPSIS > > It might be worth

Re: git MUST notify user when files will be deleted or overwritten by command

2019-03-09 Thread Duy Nguyen
On Sat, Mar 9, 2019 at 5:50 PM Kevin Daudt wrote: > I know this has come up on the git mailing list more often, but I cannot > find a relevant thread at this moment. The last discussion is probably this one https://public-inbox.org/git/87wolzo7a1@evledraar.gmail.com/ -- Duy

Re: One failed self test on Fedora 29

2019-03-09 Thread Jeffrey Walton
On Fri, Mar 8, 2019 at 12:43 PM Todd Zullinger wrote: > > Jeffrey Walton wrote: > > Fedora 29, x86_64. One failed self test: > > > > *** t0021-conversion.sh *** > [...] > > not ok 13 - disable filter with empty override > > # > > # test_config_global filter.disable.smudge false && >

Re: [PATCH v3 04/21] git-checkout.txt: fix monospace typeset

2019-03-09 Thread Martin Ågren
On Fri, 8 Mar 2019 at 10:58, Nguyễn Thái Ngọc Duy wrote: > Documentation/git-checkout.txt | 60 +- > 1 file changed, 30 insertions(+), 30 deletions(-) > > 'git checkout' []:: > - To prepare for working on , switch to it by updating > + To prepare for w

Re: [PATCH v3 10/21] checkout: split part of it to new command 'switch'

2019-03-09 Thread Martin Ågren
On Fri, 8 Mar 2019 at 11:00, Nguyễn Thái Ngọc Duy wrote: > --- (Missing signed-off-by.) > --- /dev/null > +++ b/Documentation/git-switch.txt > @@ -0,0 +1,259 @@ It looks like you base this on git-checkout.txt, which makes sense. > +--recurse-submodules:: > +--no-recurse-submodules:: > +

Re: One failed self test on Fedora 29

2019-03-09 Thread Jeffrey Walton
On Sat, Mar 9, 2019 at 7:34 AM Jeffrey Walton wrote: > > On Fri, Mar 8, 2019 at 12:43 PM Todd Zullinger wrote: > > > > Jeffrey Walton wrote: > > > Fedora 29, x86_64. One failed self test: > > > > > > *** t0021-conversion.sh *** > > [...] > > > not ok 13 - disable filter with empty override > > >

t0028-working-tree-encoding.sh test #3 data

2019-03-09 Thread Jeffrey Walton
Hi Everyone, I'm experiencing a failure in t0028-working-tree-encoding.sh. The first failure is test #3. The source states "source (test.utf16lebom, considered UTF-16LE-BOM)" but it looks like a UTF16-LE BOM followed by a UTF32-LE stream. Am I misunderstanding the data presentation? $ ./t0028-wo

[GSoC][PATCH] tests: avoid using pipes

2019-03-09 Thread Jonathan Chang
This is my attempt for this year's GSoC microproject. I copied the commit message of the commit[1] mentioned in the microproject page[2]. Is this OK? Here is a summary of what I did: - simple substitution as in c6f44e1da5[1]. - besides simple substitution, I moved some git comman

Re: t0028-working-tree-encoding.sh test #3 data

2019-03-09 Thread Torsten Bögershausen
On Sat, Mar 09, 2019 at 09:36:34AM -0500, Jeffrey Walton wrote: > Hi Everyone, > > I'm experiencing a failure in t0028-working-tree-encoding.sh. The > first failure is test #3. The source states "source (test.utf16lebom, > considered UTF-16LE-BOM)" but it looks like a UTF16-LE BOM followed by > a U

Re: [GSOC][PATCH 1/2] modified dir-iterator.c

2019-03-09 Thread Thomas Gummerer
Hi, thanks for the patch! Subject: [GSOC][PATCH 1/2] modified dir-iterator.c Commit messages should be written in the imperative mood, e.g. "modify dir-iterator.c", see also "Documentation/SubmittingPatches. Also they are generally in the format ": ". So the subject here could be something lik

Re: [GSoC][PATCH] tests: avoid using pipes

2019-03-09 Thread Thomas Gummerer
Hi, welcome and thanks for the patch! On 03/09, Jonathan Chang wrote: > This is my attempt for this year's GSoC microproject. > > I copied the commit message of the commit[1] mentioned in the microproject > page[2]. Is this OK? > > Here is a summary of what I did: > - simple substitution

Re: [PATCH v1 09/11] t: add tests for restore

2019-03-09 Thread Andrei Rybak
On 3/8/19 11:16 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > t/lib-patch-mode.sh | 12 > t/t2070-restore.sh (new +x) | 77 ++ > t/t2071-restore-patch.sh (new +x) | 105 ++ > 3 files changed

Re: What's cooking in git.git (Mar 2019, #01; Wed, 6)

2019-03-09 Thread Thomas Gummerer
On 03/07, Duy Nguyen wrote: > On Thu, Mar 7, 2019 at 7:34 PM Philip Oakley wrote: > > > > On 06/03/2019 09:44, Duy Nguyen wrote: > > > On Wed, Mar 6, 2019 at 8:34 AM Junio C Hamano wrote: > > >> * tg/checkout-no-overlay (2019-02-04) 9 commits > > >>(merged to 'next' on 2019-02-04 at 9968bcf4f

Re: What's cooking in git.git (Mar 2019, #01; Wed, 6)

2019-03-09 Thread Elijah Newren
Hi, On Sat, Mar 9, 2019 at 9:29 AM Thomas Gummerer wrote: > > On 03/07, Duy Nguyen wrote: > > On Thu, Mar 7, 2019 at 7:34 PM Philip Oakley wrote: > > > > > > On 06/03/2019 09:44, Duy Nguyen wrote: > > > > On Wed, Mar 6, 2019 at 8:34 AM Junio C Hamano wrote: > > > >> * tg/checkout-no-overlay (20

Re: [PATCH v1 02/11] restore: take tree-ish from --source option instead

2019-03-09 Thread Elijah Newren
On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > This is another departure from 'git checkout' syntax, which uses -- to > separate ref and pathspec. The observation is restore (or "git > checkout ,, ") is most often used to restore some files from > the index. If this is correct, we

Re: is it "git gc --prune=now" or "git gc --prune=all"?

2019-03-09 Thread Robert P. J. Day
On Wed, 6 Mar 2019, Junio C Hamano wrote: > Jeff King writes: > > > ... I do think the documentation should recommend "now". Possibly > > builtin/gc.c should be smarter about recognizing "all" in the > > conditional you quoted, too, though I don't know that it's all > > that important (especially

Re: [PATCH v13 18/27] stash: convert create to builtin

2019-03-09 Thread Thomas Gummerer
On 03/08, Johannes Schindelin wrote: > Hi Peff, > > On Thu, 7 Mar 2019, Jeff King wrote: > > > On Mon, Feb 25, 2019 at 11:16:22PM +, Thomas Gummerer wrote: > > > > > +static void add_pathspecs(struct argv_array *args, > > > + struct pathspec ps) { > > > > Here and elsewher

Re: [PATCH v1 01/11] checkout: split part of it to new command 'restore'

2019-03-09 Thread Elijah Newren
On Sat, Mar 9, 2019 at 4:16 AM Duy Nguyen wrote: > On Sat, Mar 9, 2019 at 1:01 AM Elijah Newren wrote: > > > +-q:: > > > +--quiet:: > > > + Quiet, suppress feedback messages. > > > + > > > +--progress:: > > > +--no-progress:: > > > + Progress status is reported on the standard error

Re: [PATCH v13 12/27] stash: convert drop and clear to builtin

2019-03-09 Thread Thomas Gummerer
On 03/07, Jeff King wrote: > On Mon, Feb 25, 2019 at 11:16:16PM +, Thomas Gummerer wrote: > > > +static int do_drop_stash(const char *prefix, struct stash_info *info, int > > quiet) > > This series hit next recently, so I started building it merged with my > -Wunused-parameters series. This

Re: [PATCH v1 03/11] restore: make pathspec mandatory

2019-03-09 Thread Elijah Newren
On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > "git restore" without arguments does not make much sense when > it's about restoring files (what files now?). We could default to > either > > git restore . > > or > > git restore :/ > > Neither is intuitive. Make the user alwa

Re: [PATCH v1 04/11] restore: disable overlay mode by default

2019-03-09 Thread Elijah Newren
On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > Overlay mode is considered confusing when the command is about > restoring files on worktree. Disable it by default. The user can still > turn it on, or use 'git checkout' which still has overlay mode on by > default. > > While at ther

Re: [PATCH v1 06/11] restore: add --worktree and --index

2019-03-09 Thread Elijah Newren
On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > 'git checkout ' updates both index and > worktree. But updating the index when you want to restore worktree > files is non-intuitive. The index contains the data ready for the next > commit, and there's no indication that the user wil

Re: [PATCH v1 07/11] restore: default to --source=HEAD when only --index is specified

2019-03-09 Thread Elijah Newren
On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > "git restore --index" does not make much sense since we're told to > restore the index from the (by default) index. Set default source to > HEAD in this case. This is basically the same as "git reset -- ". Can I suggest a slight rewor

Re: [PATCH v1 08/11] restore: support --patch

2019-03-09 Thread Elijah Newren
On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > git-restore is different from git-checkout that it only restores the > worktree by default, not both worktree and index. add--interactive > needs some update to support this mode. Nice! That removes my frowny face from a few patches

Re: [PATCH v1 10/11] completion: support restore

2019-03-09 Thread Elijah Newren
On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > Completion for restore is straightforward. We could still do better > though by give the list of just tracked files instead of all present > ones. But let's leave it for later. s/give/giving/ I'm slightly worried that due to using --

Re: [PATCH v1 11/11] doc: promote "git restore"

2019-03-09 Thread Elijah Newren
On Fri, Mar 8, 2019 at 2:17 AM Nguyễn Thái Ngọc Duy wrote: > > The new command "git restore" (together with "git switch") are added > to avoid the confusion of one-command-do-all "git checkout" for new > users. They are also helpful to avoid ambiguation context. s/ambiguation/ambiguous/ or s/ambi

Refresh index without discard_index + repo_read_index

2019-03-09 Thread Roman Perepelitsa
I’m writing a program that reads stdin in a loop and prints the equivalent of `git status` whenever it reads a character. It always prints its results for the same repository, the same pathspec, etc. The input characters have no effect on the output, only the sate of the repository does. I’m hoping

RE: git MUST notify user when files will be deleted or overwritten by command

2019-03-09 Thread Randall S. Becker
On March 9, 2019 5:48, Kevin Daudt wrote: > On Sat, Mar 09, 2019 at 10:19:03AM +, Dimitri Joukoff wrote: > > Hi, > > > > As a relatively novice user of git, there have been far too many times > > that I have lost data, sometimes quite a lot. So this proposal is > > about catering for the less

Re: git MUST notify user when files will be deleted or overwritten by command

2019-03-09 Thread Philip Oakley
On 09/03/2019 22:39, Randall S. Becker wrote: On March 9, 2019 5:48, Kevin Daudt wrote: On Sat, Mar 09, 2019 at 10:19:03AM +, Dimitri Joukoff wrote: Hi, As a relatively novice user of git, there have been far too many times that I have lost data, sometimes quite a lot. So this proposal is

Re: [PATCH 0/2] stash: handle pathspec magic again

2019-03-09 Thread Junio C Hamano
Johannes Schindelin writes: > If you care deeply about the commit history, I hereby offer to you to > clean up the built-in stash patches when you say you're ready to advance > them to `master`. What's the goal of such a rebase? To rebuild the topic as a sensible sequence of commits that logica

Re: [PATCH 1/1] mingw: allow building with an MSYS2 runtime v3.x

2019-03-09 Thread Junio C Hamano
"Johannes Schindelin via GitGitGadget" writes: > So let's invert that test case to test for *anything else* than a > version starting with "1" (for MSys). That should safeguard us for the > future, even if Cygwin ends up releasing versionsl like 314.272.65536. An obvious alternative is to do "2"

Re: t0028-working-tree-encoding.sh test #3 data

2019-03-09 Thread Jeffrey Walton
On Sat, Mar 9, 2019 at 11:10 AM Torsten Bögershausen wrote: > > On Sat, Mar 09, 2019 at 09:36:34AM -0500, Jeffrey Walton wrote: > > > > I'm experiencing a failure in t0028-working-tree-encoding.sh. The > > first failure is test #3. The source states "source (test.utf16lebom, > > considered UTF-16L

Re: [PATCH v5 1/1] worktree add: sanitize worktree names

2019-03-09 Thread Eric Sunshine
On Fri, Mar 8, 2019 at 4:28 AM Nguyễn Thái Ngọc Duy wrote: > Worktree names are based on $(basename $GIT_WORK_TREE). They aren't > significant until 3a3b9d8cde (refs: new ref types to make per-worktree > refs visible to all worktrees - 2018-10-21), where worktree name could > be part of a refname

Re: [PATCH v3 01/21] git-checkout.txt: spell out --no-option

2019-03-09 Thread Eric Sunshine
On Fri, Mar 8, 2019 at 4:58 AM Nguyễn Thái Ngọc Duy wrote: > It's easier to search for and also less cryptic. > --- Your sign-off is missing from the entire series.

Re: [PATCH v3 18/21] switch: no worktree status unless real branch switch happens

2019-03-09 Thread Eric Sunshine
On Fri, Mar 8, 2019 at 4:59 AM Nguyễn Thái Ngọc Duy wrote: > When we switch from one branch to another, it makes sense to show a > summary of local changes since there could be conflicts, or some files > left modified When switch is used solely for creating a new > branch (and "switch" to the

Re: [PATCH v3 19/21] t: add tests for switch

2019-03-09 Thread Eric Sunshine
On Fri, Mar 8, 2019 at 4:59 AM Nguyễn Thái Ngọc Duy wrote: > diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh > @@ -0,0 +1,87 @@ > +test_expect_success 'switch to a commit' ' > + test_must_fail git switch master^{commit} > +' The title of this test was a bit misleading for me; I would hav

Re: [GSoC][PATCH] tests: avoid using pipes

2019-03-09 Thread Christian Couder
On Sat, Mar 9, 2019 at 4:50 PM Jonathan Chang wrote: > > This is my attempt for this year's GSoC microproject. Thanks for being interested in this year's GSoC and doing a microproject. > I copied the commit message of the commit[1] mentioned in the microproject > page[2]. Is this OK? > > Here is

[PATCH/RFC v1 1/1] convert.c: Escape sequences only for a tty in trace_encoding()

2019-03-09 Thread tboegi
From: Torsten Bögershausen The content of a buffer can be dumped using trace_encoding() before and after the encoding is converted. The current function trace_encoding() in convert.c tries to make the output easier to read: The byte position and the character itself are dimmed, allowing the eye t

Re: t0028-working-tree-encoding.sh test #3 data

2019-03-09 Thread Torsten Bögershausen
On Sat, Mar 09, 2019 at 08:57:07PM -0500, Jeffrey Walton wrote: > On Sat, Mar 9, 2019 at 11:10 AM Torsten Bögershausen wrote: > > > > On Sat, Mar 09, 2019 at 09:36:34AM -0500, Jeffrey Walton wrote: > > > > > > I'm experiencing a failure in t0028-working-tree-encoding.sh. The > > > first failure is