James Moger
2014-03-10 1221a4386de08586e06917fe163333d3de76662b
Clarify ticket fetch instructions
2 files modified
14 ■■■■ changed files
src/main/java/com/gitblit/tickets/commands.md 4 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/pages/TicketPage.java 10 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/tickets/commands.md
@@ -2,10 +2,10 @@
To review an updated patchset
    git fetch && git checkout ${ticketBranch} && git pull --ff-only
    git fetch origin && git checkout ${ticketBranch} && git pull --ff-only
To review a rewritten patchset
    git fetch && git checkout ${ticketBranch} && git reset --hard origin/${ticketBranch}
    git fetch origin && git checkout ${ticketBranch} && git reset --hard origin/${ticketBranch}
src/main/java/com/gitblit/wicket/pages/TicketPage.java
@@ -1203,8 +1203,8 @@
        };
        panel.add(pathsView);
        addPtReviewInstructions(user, repository, panel);
        addGitReviewInstructions(user, repository, panel);
        addPtCheckoutInstructions(user, repository, panel);
        addGitCheckoutInstructions(user, repository, panel);
        panel.add(createMergePanel(user, repository));
        return panel;
@@ -1278,13 +1278,13 @@
        return x;
    }
    protected void addGitReviewInstructions(UserModel user, RepositoryModel repository, MarkupContainer panel) {
    protected void addGitCheckoutInstructions(UserModel user, RepositoryModel repository, MarkupContainer panel) {
        panel.add(new Label("gitStep1", MessageFormat.format(getString("gb.stepN"), 1)));
        panel.add(new Label("gitStep2", MessageFormat.format(getString("gb.stepN"), 2)));
        String ticketBranch  = Repository.shortenRefName(PatchsetCommand.getTicketBranch(ticket.number));
        String step1 = "git fetch";
        String step1 = "git fetch origin";
        String step2 = MessageFormat.format("git checkout {0} && git pull --ff-only\nOR\ngit checkout {0} && git reset --hard origin/{0}", ticketBranch);
        panel.add(new Label("gitPreStep1", step1));
@@ -1294,7 +1294,7 @@
        panel.add(createCopyFragment("gitCopyStep2", step2.replace("\n", " && ")));
    }
    protected void addPtReviewInstructions(UserModel user, RepositoryModel repository, MarkupContainer panel) {
    protected void addPtCheckoutInstructions(UserModel user, RepositoryModel repository, MarkupContainer panel) {
        String step1 = MessageFormat.format("pt checkout {0,number,0}", ticket.number);
        panel.add(new Label("ptPreStep", step1));
        panel.add(createCopyFragment("ptCopyStep", step1));